Adding specified loop outputs
Show older comments
I am trying to make a figure which plots the sum of 3 specific loop outputs. output is the different outputs of the loop and I am trying to get the sum of output 1, 2, and 3. This is what I have:
figure
Sum1=sum(output(1:3));
plot(t,Sum1)
But I am just getting a blank graph and Sum1 for some reason has a value of 0 in my workplace. I am not sure which part of what I am doing is incorrect. Thank you for your time!
4 Comments
Mathieu NOE
on 29 Mar 2024
hello again
what is the size of output ?
S
on 30 Mar 2024
Example:
output = rand(5,2000)
output(1:3)
Sum1=sum(output(1:3))
Thus you try to plot one single value (which seems to be 0 in your case).
Accepted Answer
More Answers (0)
Categories
Find more on Logical 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!