how to plot? i got Error using tabular/plot (line 156) There is no plot method for the 'table' class. Plot the variables in a table using dot or brace subscripting.
11 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
sadeem alqarni
el 5 de Mzo. de 2019
Comentada: Walter Roberson
el 6 de Nov. de 2022
vel = table([0;.125;0.25;0.375;0.5;0.625;0.75;0.875;1;1.125;1.25;1.375;1.5;1.625;1.75;1.875;2],[0; 0.024934942578746697937373773042546; 0.049480663428674892204211876103623; 0.073253551446249896676617134859737; 0.095881199630495565880615199318259; 0.11700795711194655959310358044298; 0.1363003943635875927477781482227; 0.15345261966609088937500193824478; 0.16819135141725456884193011923064; 0.18028063867519389490367023494122; 0.18952609200141862076834501332858; 0.19577849294980553501413718323421; 0.19893664111442157919172260532557; 0.19894932805948448380986354760928; 0.19581634817447727513592110333613; 0.18958850260295146039225538942577; 0.18036659655686807780641359567233])
plot(vel)
0 comentarios
Respuesta aceptada
Walter Roberson
el 5 de Mzo. de 2019
table objects cannot be plotted in MATLAB. You would need to extract the data from the table, such as
plot(vel{:,1})
1 comentario
Walter Roberson
el 6 de Nov. de 2022
In the time since the above post, plot() now has some ability to plot tables.
Más respuestas (1)
Surakshaa vc
el 6 de Nov. de 2022
%G=gamma G = 1.4; M1 = 1:0.01:5.19; M2 = sqrt((M1.^2*(G-1)+2)./(2*G*M1.^2-(G-1))); %pressureratio=P2/P1 presureratio =((2*G*M1.^2)./(G+1))-((G-1)./(G+1)); %densityratio=rho2/rho1 densityratio = ((G-1)*M1.^2)./((G-1)*M1.^2+2); %tempratio=T2/T1 tempratio = ((1+(G-1/2)*M1.^2).*((2*G/G-1)*M1.^2-1))./((M1.^2*(2*G/G-1))+(G-1/2)); %totalpresureratio=P02/P01 totalpresureratio=((((G+1/2)./M1.^2)./(1+(G-1./2)*M1.^2).^(G/G-1))).*((2*G/G+1)*M1.^2-(G-1/G+1));
table(M1 ,M2,presureratio,tempratio,densityratio,totalpresureratio)
1 comentario
Walter Roberson
el 6 de Nov. de 2022
I do not understand how this answers the question that was asked?
Ver también
Categorías
Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!