MATLAB Answers

i am trying to made a code to int the numbers of time i want

1 view (last 30 days)
Bader Herzallah
Bader Herzallah on 7 May 2020
Edited: Rik on 7 May 2020
syms x n y z a;
n=input('enter number of int');
for y=1:n;
z=x^2;
a=int(z);
z=a;
end
like i want to int x^2 two time the answer will be x^4/12 but in matlab but i cant get the int to intgrate the new value of z

  0 Comments

Sign in to comment.

Accepted Answer

David Wilson
David Wilson on 7 May 2020
Remove the z=x^2 from the loop.
syms x n y z a;
n= 5
z=x^2;
for y=1:n
z=int(z)
end

  0 Comments

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!