

Let us see another example of saveas statement, In this, we create a bar chart and for a bar chart, we take data in variable y1. We take saveas function in the parenthesis we take gcf, to save a current figure we must specify fig as gcf, then we take a file name this example we take ‘Barchart1’ as a name and we specify the format type ‘formattype’ to epsc. We save this figure as an EPS file and we specify epsc to save this image it in colour format. Then we use a plot(x, y), it will generate a figure this figure we want to save using a saveas function. In the y variable, we take data that we plot on the x axis. In x variable, we specify a range 1 to 20 with a difference of 1. We take two variables x and y for plotting data. Let us consider an example for saveas function, in this example, we create a figure for creating a figure we use a plot, the plot is an inbuilt function available on matlab for creating a continues signal of a provided data. We take saveas function in the parenthesis we take gcf, then we take a file name with a figure extension this example we take ‘Barchart11’ as a name with extension. Then this generated bar graph is saving in. If x1 is a y-by-z matrix, then bar creates y groups of z bars. The bar graph creates using the bar(x1) function with one bar for each element in x1. Then we use a bar function which is available on matlab, it’s an inbuilt function of matlab.

We take a bar chart data in a square bracket each data number is separated by a space and these data are assigning to a variable x1. In this example, we create a bar chart, for creating a bar chart we take data in variable x1. Let us see an example for a saveas statement basically, saveas function is an inbuilt function available on a matlab, it used for save figure to a specific format. Examples of Matlab Saveasįollowing are the examples are given below: Example #1 png and we also specify the format type in ‘formattype’ argument. For saving this created image we take saveas in parenthesis gcf, then we take a file name with a figure extension let us assume we take ‘Barchart11’ as a name with extension. Then this figure is saved using a saveas function. Or we can create an image using a plot function, plot is also an inbuilt function available on matlab plot is used to draw a continuous line and figure like an analog signals. For using a saveas function first we want to create an image for creating an image we use a bar function, bar is an inbuilt function available on matlab, the bar graph creates using bar(x1) function with one bar for each element in x1. So for this function, we have syntax as we saw above. The saveas function is used to save an image with a specific file format, format like. Saveas(fig,filename,formattype) How to Do Matlab Saveas? The syntax for Matlab saveas functions as shown below:. Hadoop, Data Science, Statistics & others
