Hey i need quick help with a code

clc;clear;close all;
% pirmoji tiesė išreikšta parametrinėmis lygtimis
x1 = @(t) 3+2*t;
y1 = @(t) -1+4*t;
z1 = @(t) 2-1*t;
% antroji tiesė išreikšta parametrinėmis lygtimis
x2 = @(t) 3+4*t;
y2 = @(t) 2+2*t;
z2 = @(t) -2+4*t;
% trečioji tiesė išreikšta parametrinėmis lygtimis
x3 = @(t) 1+2*t;
y3 = @(t) 1+1*t;
z3 = @(t) -3+2*t;
% komanda ezplot3 naudojame nubrėžiant tiesės trimatį grafiką
ez1=ezplot3(x1, y1, z1, [-100, 100], 10, "animate");
set(ez1,'color','r','lineWidth',1)
hold on
ez2=ezplot3(x2, y2, z2, [-100, 100], 10, "animate");
set(ez2,'color','b','lineWidth',2)
hold on
ez3=ezplot3(x3, y3, z3, [-100, 100], 10, "animate");
set(ez3,'color','m','lineWidth',3)
%hold on komanda leidžia viename grafike nubrėžti kelias kreives
Unrecognized function or variable 'T'.
Error in ezplot3 (line 111)
X = ezplotfeval(x,T);
Error in mat_2a (line 18)
ez1=ezplot3(x1, y1, z1, [-100, 100], 10, "animate");

 采纳的回答

I think the problem is an unrecognized input option passed to ezplot3. Specifically, the 10 causes the input argument list to get parsed incorrectly. Try this instead (also note the single quotes rather than double quotes):
ez1=ezplot3(x1, y1, z1, [-100, 100], 'animate');
and so on for the other calls to ezplot3.

更多回答(0 个)

类别

在 帮助中心 和 File Exchange 中查找有关 Animation 的更多信息

产品

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by