create a surface plot from multiple 2d plots
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
hi all, i am a matlab beginner, and i needed help in this program. i have a parabola with certain parametrs, and i need to plot this same parabola 13 times to create a 3d surface, and then i add 13 points on the plot. i searched, and i was able to achieve this, but using plot3, which just plots the 13 parabolas separately and not as a 3d surface here is what i have done
clear
clc
load('D:\id.mat')
load('D:\cr.mat')
load('D:\xc.mat')
x1=xc(1,:); %contains 13 points each point will be plotted against each of x2
x2=xc(2,:); %contains 13 points
crx=cr(1,:);
cry=cr(2,:); %parabola to be plotted 13 times
y=-7:((6+7)/2055):6;
x=0:(0.06/13):0.06;
ymat=repmat(y,1,13);
xmat=repmat(x,numel(ymat),1);
zmat=[cry cry cry cry cry cry cry cry cry cry cry cry cry];
plot3(xmat,ymat,zmat,'k')
grid
hold on
plot3(x(1:13),x1,x2,'-b*')
xlabel('Time')
ylabel('x1')
zlabel('x2')
hold off
0 commentaires
Réponses (1)
Gareth Thomas
le 25 Oct 2015
% y = a*x*x + b*x + c
x = -5:.1:5;
a = -5:5;
b = -5:5;
y = a'*(x.*x)+b'*x;
surf(y);
0 commentaires
Voir également
Catégories
En savoir plus sur Spline Postprocessing dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!