output of the following MATLAB code.
Posted in matlab
No comments
Friday, August 1, 2014 By Anonymous
Q#6:
What will be the output of the following MATLAB code.
S = 1; n = 1;
while S+(n+1)^2 < 100
n = n+1; S = S + n^2;
end
[n,S]
Solution:
Here below is the output
%Output displayed
Related posts
- Plot the following MATLAB functions: y = 3x+2 with x = 0, 0.25, 0.5, ...., 7.75, 8
- MATLAB function that takes a matrix as argument and then ask from the user
- MATLAB program which computes the mean and standard deviation of the data. Use FOR LOOPs.
- Plot the following MATLAB functions y = ln(exp(x^-1)) with x = 1, 1.5, 2, ..., 4
- Plot the following MATLAB functions: y = exp(-x^2) with x = 0, 0.1, 0.2, ..., 2
Share this post
0 comments: