Posts

Showing posts from November, 2021

How to draw animated plots through code in MatLab? -- MatLab

 How to draw animated plots through code in MatLab? -- MatLab How to draw animated plots through code in MatLab? [Ans] The group function animatedline addpoints drawnow [description] animatedline create an animated line.  It can be drawn animatedly. more syntax details on: Create animated line - MATLAB animatedline (mathworks.com) addpoints add points to the animated line. more syntax and details on: Add points to animated line - MATLAB addpoints (mathworks.com) drawnow It is used for updating the figure and process callbacks. more syntax and details on: Update figures and process callbacks - MATLAB drawnow (mathworks.com) [Useful tips] When you want to generate an animated line, create the animated line by animatedline command,  then add points for drawing by addpoints command. Finally, update the figure by drawnow command. It is widely used such as singal generator. 

How to check whether point is changed or not in MatLab? - ischange -- MatLab

Image
 How to check whether point is changed or not in MatLab? - ischange -- MatLab How to check whether point is changed or not in MatLab? [Ans] ischange NOT ischanged [Syntax] < TF> = ischange(<A>) < TF> = ischange(A,<method>) < TF> = ischange( ___ ,<dim>) < TF> = ischange( ___ ,<Name>,<Value>) [<TF>,<S1>] = ischange( ___ ) [TF,S1,S2] = ischange( ___ ) [Description] Find abrupt points in data. i.e. find the points which is changed by your definition or by default. By default, <method> is set to mean. e.g.   TF = ischange(A)  It will return true when there is an abrupt change in mean of corresponding element of A. Otherwise, return false.   TF = ischange(A,'variance')  It will return true when there is an abrupt change in variance of corresponding element of A. Otherwise, return false. (1) [<TF>,<S1>,<S2>]=ischange(__) It will return 3 variable. <TF>  check an abrupte...

How to check the point in the plot is outlier in MatLab? - MatLab

 How to check the point in the plot is outlier in MatLab? - MatLab How to check the point in the plot is outlier in MatLab? [Ans] isoutlier [Syntax] TF = isoutlier(A) TF = isoutlier(A,method) TF = isoutlier(A,'percentiles',threshold) TF = isoutlier(A,movmethod,window) TF = isoutlier( ___ ,dim) TF = isoutlier( ___ ,Name,Value) [TF,L,U,C] = isoutlier( ___ ) [Description] find outliers in data. outliers, outlier points, are  abnormal points. In MatLab, by default, an outlier is a value that is more than 3 scaled MAD(median  absolute derivations) away from the median. isoutlier(<A>)  If A is a vector, it will calculate median of A and check each point in the vector is an outlier or not. If A is a matrix or table, it will operate column by column of A. i.e. it will operate every columns  of A.  If A is a multi-dimension array, it will operate along the first dimension whose size is not equal to 1. isoutlier(<A>, <methodName>) It will call isout...

How to add legend in Matlab? - legend -- MatLab

 How to add legend in Matlab? - legend -- MatLab  How to add legend in Matlab? [Ans] legend [Description] Add a legend to axes of the figure. more details on: Add legend to axes - MATLAB legend (mathworks.com)

How to check the ax is hold or not in MatLab? - ishold -- MatLab

Image
How to check the ax is hold or not in MatLab? - ishold -- MatLab ishold command [Description] tf =ishold return true when current ax is hold. Otherwise, return false. tf=ishold(ax) return true when the ax is hold. Otherwise, return false. [NOTE] Great Importance !!! Pay  a lot of attention on it!!! When you use ishold command but there are no figure . The MatLab will create a new empty figure and return false. e.g. more details on: Current hold state - MATLAB ishold (mathworks.com)

How to hold plots in MatLab? - hold -- MatLab

Image
 How to hold plots in MatLab? - hold -- MatLab hold command [description] the hold command is used to set to hold  state of plots or not. When the plot is hold, it will not disapear the next time you plot the other graph. You will see two graphs will be overlapping. hold on  or  hold ('on') hold the state on hold on the current plot. it will not disapear the next time you plot the other graph. hold off or hold ('off'') hold the state off e.g. above fig. are about no 'hold on' above fig. are about 'hold on' hold  toggle hold state between on and off. hold (ax, ___) set ax hold state. more details on Retain current plot when adding new plots - MATLAB hold (mathworks.com)

How to delete a plot in MatLab? - delete -- MatLab

 How to delete a plot in MatLab? - delete -- MatLab delete commoand delete <variable to store plot> source: Delete files or objects - MATLAB delete (mathworks.com)

How to delete a specified file in MatLab? - delete -- MatLab

 How to delete a specified file in MatLab? - delete -- MatLab delete command delete <filename> source: Delete files or objects - MATLAB delete (mathworks.com)

How to close figure in MatLab? - close -- MatLab

 How to close figure in MatLab? - close -- MatLab close command How to close current figure? close; How to close all figure? close all; or close('all'); source: Close one or more figures - MATLAB close (mathworks.com)

How to create new figure ( window for plotting ) in MatLab? - figure -- MatLab

 How to create new figure ( window for plotting ) in MatLab? - figure -- MatLab figure command it take a key-value pair arguments. So number of input argument can only be even (0 , 2 , 4 ,...). How to create new empty figure? f=figure; How to create new figure empty figure and set its  Name as 'Measured Data'? figure( 'Name' , 'Measured Data' ); How to create new figure empty figure and set it as figure f1? f2=figure(f1); source: Create figure window - MATLAB figure (mathworks.com)

How to create a mesh grid point in MatLab - meshgrid -- MatLab

How to create a mesh grid point in MatLab - meshgrid  -- MatLab Here is my code and results about meshgrid.   %meshgrid_example clear clc x = 1:3; y = 1:5; [X,Y] = meshgrid(x,y) %{ X = 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 Y = 1 1 1 2 2 2 3 3 3 4 4 4 5 5 5 %} "1\n" x = 1:3; y = 1:5; [X,Y]=meshgrid(x) %similar to %[X,Y]=meshgrid(x,x) %{ X = 1 2 3 1 2 3 1 2 3 Y = 1 1 1 2 2 2 3 3 3 %} "2\n" x = 1:3; y = 1:5; z = 1:4; [X,Y,Z]=meshgrid(x,y,z) %{ X(:,:,1) = 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 X(:,:,2) = 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 X(:,:,3) = 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 X(:,:,4) = 1...

images in MatLab -- MatLab

 images in MatLab -- MatLab type of images image imagesc 2D image imagesc details image display image from array. imagesc display image with scaled colors. more details on: Types of MATLAB Plots - MATLAB & Simulink (mathworks.com)

animation in MatLab -- MatLab

 animation in MatLab -- MatLab type of animation animatedline comet comet3 2D animatedline comet 3D comet3 more details on: Types of MATLAB Plots - MATLAB & Simulink (mathworks.com)

volume visualization in MatLab -- MatLab

volume visualization in MatLab -- MatLab type of volume visualization  streamline streamslice streamparticles streamribbon streamtube coneplot slice  2D streamline streamslice streamparticles 3D streamribbon streamtube coneplot more details on: Types of MATLAB Plots - MATLAB & Simulink (mathworks.com)

surface and mesh plots in MatLab -- MatLab

 surface and mesh plots in MatLab -- MatLab type of surface and mesh plots surf surfc surfl ribbon pcolor fsurf fimplicit3 mesh meshc meshz waterfall fmesh 2D pcolor 3D surf surfc      surfl ribbon fsurf fimplicit3 mesh meshc meshz waterfall fmesh more details on: Types of MATLAB Plots - MATLAB & Simulink (mathworks.com)

vector fields in MatLab -- MatLab

 vector fields in MatLab -- MatLab type of vector fields quiver quiver3 feather 2D quiver feather 3D quiver3 more details on: Types of MATLAB Plots - MATLAB & Simulink (mathworks.com)

contour plots in MatLab -- MatLab

contour plots in MatLab -- MatLab  type of contour plots contour contourf contour3 contourslice fcontour 2D contour  contourf contourslice fcontour 3D contour3 more details on: Types of MATLAB Plots - MATLAB & Simulink (mathworks.com)

polar plots in MatLab -- MatLab

 polar plots in MatLab -- MatLab definition Easy-to-use polar coordinate plotter type of polar plots polarplot polarhistogram polarscatter polarbubblechart compass ezopolar 2D polarplot polarhistogram polarscatter polarbubblechart compass ezpolar more details on: Types of MATLAB Plots - MATLAB & Simulink (mathworks.com)

geoplots in MatLab -- MatLab

geoplots in MatLab -- MatLab   type of geographic plots geoplot geoscatter geobubble 2D geoplot geoscatter geobubble more details on: Types of MATLAB Plots - MATLAB & Simulink (mathworks.com)

discrete data plots in MatLab -- MatLab

 discrete data plots in MatLab -- MatLab  type of discrete data plots bar barh bar3 bar3h pareto stem stem3 stairs 2D bar barh stem stairs pareto 3D bar3 bar3h stem3 details bar bar vertcial plot barh  bar horizontal plot pareto pareto chart.  stem stem chart It look like stem. more details on: Types of MATLAB Plots - MATLAB & Simulink (mathworks.com)

Data distribution plots in MatLab -- MatLab

 Data distribution plots in MatLab -- MatLab type of data distribution plots histogram histogram2 pie pie3 scatterhistogram swarmchart swarmchart3 wordcloud bubblecloud heatmap parallelplot plotmatrix 2D histogram pie scatterhistogram swarmchart wordcould bubblecloud heatmap parallel plot plotmatrix 3D histogram3 pie3 swarmchart3 [NOTE] histogram2 does not plot in 2D spaces. It plots in 3D spaces. more details on: Types of MATLAB Plots - MATLAB & Simulink (mathworks.com)

scatter and bubble charts in MatLab -- MatLab

scatter and bubble charts in MatLab -- MatLab  type of scatter and bubble charts scatter scatter3 bubblechart bubblechart3 swarmchart swarmchart3 spy 2D scatter bubblechart swarmchart spy 3D scatter3 bubblechart3 swarmchart3 NO SPY3 details scatter 2D scatter chart. Every point is scattered. bubble 2D bubble chart. It looks like bubbles. more details on: Types of MATLAB Plots - MATLAB & Simulink (mathworks.com)

line plots in MatLab -- MatLab

line plots in MatLab -- MatLab type of line plots I list common line plots I know. line plots plot plot3 stairs errorbar area stackedplot loglog semilogx semilogy fplot fplot3 fimplicit type by the specified filter 2D the following are about 2D plots. plot loglog semilogx semilogy stairs fplot fimplicit log the following are plots about log plots. loglog semilogx semilogy details I just only list a few plots. More details on the matlab official website. Types of MATLAB Plots - MATLAB & Simulink (mathworks.com) plot common 2D line plot. plots common 3D line plot. stairs stair 2D plot. a plot which looks like to stair. loglog  2D all axis log plot. 2D x-y axis log plot. x and y axis are about log. semilogx 2D x axis log plot. x axis is about log. semilogy 2D y axis log plot.  y axis is about log. fplot function plot. plot through given function. You can throw a function and plot through  fplot.