Receiving Errors On Matrix Dimensions
Show older comments
Hello, I am unsure if I am making a simple mistake but I am receiving errors for matrix size within my equation code. Here is the code:
for
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
I am receiving these error messages:
Error using * Inner matrix dimensions must agree.
Error in FeedbackControlSystem (line 65) c(t) = 1 - (1/B) * exp(1) .^ -(Z * W_n * t) * sin(B * W_n * t + Theta);
Error using ^ One argument must be a square matrix and the other must be a scalar. Use POWER (.^) for elementwise power.
Error in FeedbackControlSystem (line 65) c(t) = 1 - (1/B) * exp(1)^-(Z * W_n * t) * sin(B * W_n * t + Theta);
Any help would be greatly appreciated. Thank you!
7 Comments
KSSV
on 18 Apr 2018
What is t here?
Veera Kanmani
on 18 Apr 2018
c(t) = 1 - (1/B) * exp(1) .^ -(Z * W_n * t) * sin(B * W_n * t + Theta);.. i think the problem occurs, can you specify code in detail manner and what is t value ?
Jacob Hammer
on 24 Apr 2018
Jacob Hammer
on 24 Apr 2018
Jacob Hammer
on 24 Apr 2018
Jacob Hammer
on 24 Apr 2018
Jacob Hammer
on 24 Apr 2018
Accepted Answer
More Answers (0)
Categories
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!.png)
.png)
.png)