Info

This question is closed. Reopen it to edit or answer.

I have 3 outputs but the scope shows 20 outputs

1 view (last 30 days)
furkan mola
furkan mola on 5 May 2020
Closed: MATLAB Answer Bot on 20 Aug 2021
function [p, v, a]=findit(theta_dot)
r = 120*10^-3;
c = 250*10^-3;
t = 0:0.001:(60/500);
theta = theta_dot*t;
d1 = r*cos(theta);
h = r*sin(theta);
d2 = (c.^2-h.^2).^(1/2);
p = d1 + d2;
v = -r.*theta_dot.*sin(theta)-(r.^2.*theta_dot.*sin(2.*theta))./(2*(c.^2-r.^2.*sin(theta).^2)).^(3/2);
a = -r.*theta_dot.^2.*cos(theta)-(4*r.^2.*theta_dot.^2.*cos(2.*theta).*(c.^2-r.^2.*sin(theta).^2)+(r.^2.*theta_dot*sin(2.*theta).^2))/(4*(c.^2-r.^2.*sin(theta).^2).^(3/2));
v = v * 100;
a = a * 100;
I give 500*2*pi/60 to input of function.
  3 Comments
jessupj
jessupj on 5 May 2020
Edited: jessupj on 5 May 2020
just a though: the horizontal axis of the scope is usually 'time', but it doesn't look like you have any time dependence other than within the function. perhaps it's graphing your 3-value timeseries as [3*time] constants?
furkan mola
furkan mola on 6 May 2020
Edited: furkan mola on 6 May 2020
thanks for your answers. i solved problem with Ameer Hamza's model. i tried with clock block before but the resolution was not good. so i tried this way.

Answers (1)

Ameer Hamza
Ameer Hamza on 5 May 2020
Edited: Ameer Hamza on 5 May 2020
It is not displaying 20 signals. In fact, it is displaying 121*3=363 signals.
That is not the correct way to define time-dependent signals in Simulink. Check the attached file (saved in R2019a) to see how to create those signals in Simulink correctly.
  2 Comments
furkan mola
furkan mola on 6 May 2020
thank you for your interest. i have tried clock block with product block for ;
theta = theta_dot*t;
but the resolution was not good and i could not fix. now, i tried your model and i got the same result. but i have set decimation = 100 in your model and i solve all problems. thanks a lot.

Products


Release

R2019a

Community Treasure Hunt

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

Start Hunting!