How to solve Error using == ?
Afficher commentaires plus anciens
Hello I need somehelp for a school Project and the Teacher doesn't know either the Answer and how to write the Code:
I've tried something but I get some Errors like: Error using == and probably others that I haven't found
Can anyone Help me solve this as fast as posible? :D I get the Error where is with Bold
clear
clc
I=.05;
t0=0;
tf=.2;
v0=[0 4.367*10^(-5) 4*10^6 0 .00389];
% tic;[t,v]=ode45(@Program11,[t0 tf],v0,.0000000000001,1);toc
tic;[t,v]=ode45(@Program11,[t0 tf],v0);toc
%set(gcf,'position',[100 100 800 550])
set(gcf,'position',[0 0 1100 800])
plot(t,v(:,1),'g');grid
title(['VITEZA VENTILULUI'])
xlabel('timp [s]');ylabel('viteza [m/s]');
figure(1)
plot(t,10.^(3).*v(:,2),'g');grid
title(['POZITIA VENTILULUI'])
xlabel('timp [s]');ylabel('pozitia [mm]');
figure(2)
plot(t,10.^(-5).*v(:,3),'g');grid
title(['PRESIUNEA IN CAMERA "A" '])
xlabel('timp [s]');ylabel('presiunea [bar]');
figure(3)
plot(t,v(:,4),'g');grid
title(['VITEZA MOTORULUI'])
xlabel('timp [s]');ylabel('viteza [m/s]');
figure(4)
plot(t,10.^(3).*v(:,5),'g');grid
title(['POZITIA MOTORULUI'])
xlabel('timp [s]');ylabel('deplasare [mm]');
pause
close
w=max(size(t));
Vf=v(w,4);
K=Vf/I;
i=find(t>.1);
M=max(v(i,4));
iM=find(v(:,4)==M);
disp('Factorul de amplificare=');disp(K);
j=find(t>t(iM));
u=min(v(j,4));
iu=find(v(:,4)==u);
k=find(t>t(iu));
m=max(v(k,4));
im=find(v(:,4)==m);
A1=M-Vf;
A2=m-Vf;
T=t(im)-t(iM);
fr=1/T;
omega=2*pi*fr;
delta=(log(A1/A2))/(2*pi);
A=v(w,1);B=v(w,2);C=v(w,3);D=v(w,4);E=v(w,5);
disp('viteza ventil=');disp(A);
disp('pozitie ventil=');disp(B);
disp('presiune=');disp(C);
disp('viteza motor=');disp(D);
disp('pozitie motor=');disp(E);
disp('Frecventa proprie=');disp(fr);
disp('Factorul de amortizare=');disp(delta);
disp('OMEGA=');disp(omega);
5 commentaires
madhan ravi
le 15 Jan 2019
Program11 ? upload it
Adam
le 15 Jan 2019
Please give an exact error message if you are getting an error. This should pinpoint it to 1 line as well as giving more information about what is going wrong.
Steven Lord
le 15 Jan 2019
What is the exact full text of the error message you receive (all the red text)? Don't paraphrase, don't summarize, copy and paste it here verbatim. The full message contains information that may help us determine the cause of the error.
Nuber Claudiu
le 15 Jan 2019
TADA
le 15 Jan 2019
The Error Message Says It All...
Put A Breakpoint In Line 47, run The Script Then Look At The Sizes Of v And m.
For This Comparison To Work m Should Be A Column Vector Of The Same Size As The Height Of Matrix v
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Ordinary Differential Equations dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!