Info

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

Subscript Indices Error Prompt

1 view (last 30 days)
Jacob Hammer
Jacob Hammer on 24 Apr 2018
Closed: MATLAB Answer Bot on 20 Aug 2021
I am receiving this error code. Please help. I am attempting to plot a feedback response system.

Answers (1)

KSSV
KSSV on 24 Apr 2018
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 Comments
Jacob Hammer
Jacob Hammer on 24 Apr 2018

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 on 24 Apr 2018
C(T,:)= your expression

This question is closed.

Tags

Community Treasure Hunt

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

Start Hunting!