Info

此问题已关闭。 请重新打开它进行编辑或回答。

Subscript Indices Error Prompt

3 次查看(过去 30 天)
Jacob Hammer
Jacob Hammer 2018-4-24
关闭: MATLAB Answer Bot 2021-8-20
I am receiving this error code. Please help. I am attempting to plot a feedback response system.

回答(1 个)

KSSV
KSSV 2018-4-24
c(t) is wrong. Because t will be having zeros, and it cannot be used as indices. Use.
C{T} = your expression.
Note: From next time, please don't attach code as image snippet. Copy and paste the code.
  3 个评论
Jacob Hammer
Jacob Hammer 2018-4-24

also this is the actual code:

% Must plot c(t) vs t for set values for Z and W_n

% Z = 0.1

% W_n = 2.5 rad/s

for T = 1

t = linspace(0*T,3600*T,360000);

    c = zeros(1,360000);

Z = 0.1;

W_n = 2.5;

B = sqrt(1 - Z^2);

Theta = atan(B/Z);

c{t} = 1 - ((1/B) .* (exp(1) .^(-Z * W_n .* t)) .* (sin(B .* W_n .* t + Theta)));

end

KSSV
KSSV 2018-4-24
C(T,:)= your expression

此问题已关闭。

标签

Community Treasure Hunt

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

Start Hunting!

Translated by