how can i make the program to chose a random value of (w) ,, if (m) is matrix input

u=(t.*sin(3.*t)).^m;
w=diff(u,t,2);
dy1=diff(y,t,1);
dy2=diff(y,t,2);
y(t)=dsolve(dy2-(5*dy1)+(4*y)==randi(w),dy2(0)==0,dy1(0)==0,dy2==0,dy1(0)==0);

 Accepted Answer

Try randi():
randomIndex = randi(length(w), 1);
randomW = w(randomIndex);
or something like that.

3 Comments

Warning: The number of equations exceeds the number of indeterminates. Trying heuristics to reduce to square system.
> In symengine (line 57)
In mupadengine/evalin (line 102)
In mupadengine/feval (line 158)
In dsolve>mupadDsolve (line 332)
In dsolve (line 193)
Warning: Explicit solution could not be found.
> In dsolve (line 201)
I don't think that's related to choosing a random value from w.
what can i do .. i have to do this assignment

Sign in to comment.

More Answers (0)

Categories

Find more on Particle & Nuclear Physics in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!