How to set a force equal to one value over a range of theta and another value for the other range of theta?

1 Ansicht (letzte 30 Tage)
for i=1:1:length(theta2)
if (0<=i && i<180)
F=[100,0];
elseif (180<=i && i<=360)
F=[-2000,0];
end
end

Antworten (1)

Askic V
Askic V am 2 Dez. 2022
theta = linspace(0,360);
force = zeros(size(theta));
force (theta >= 0 & theta < 180) = 100;
force(theta >= 180 & theta <= 360) = -2000;
plot(theta, force);

Kategorien

Mehr zu Programming finden Sie in Help Center und File Exchange

Tags

Produkte


Version

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by