How can I derive solution in matrix form?
情報
この質問は閉じられています。 編集または回答するには再度開いてください。
古いコメントを表示
i want to get solutions with varying x from 0.201 to 0.210
the problem i have is like the below
x=0.201:0.001:0.210;
eqn=x^2*y^4+~~~~~~
and i want to get solutions of y in matrix form
and plot it with x
plot(x,y)
How can i get this solution in matrix form?
0 件のコメント
回答 (2 件)
Mischa Kim
2015 年 3 月 26 日
Hello Junsoo, what relevance has eqn in computing y as a function of x?
In general, you need to use the dot notation when e.g. multiplying vectors. Try for example:
x = 0.201:0.001:0.210;
y = x.^2.*sqrt(3*x);
plot(x,y)
4 件のコメント
Junsoo Lee
2015 年 3 月 26 日
Roger Stafford
2015 年 3 月 26 日
If x*(y^4+y)=0 is your equation, the solutions for y will be totally independent of the values of x, so it makes no sense to plot y against x.
Junsoo Lee
2015 年 3 月 26 日
Junsoo Lee
2015 年 3 月 27 日
James Tursa
2015 年 3 月 26 日
Use the dot versions of the operators to get element-wise operations. E.g.,
eqn=x.^2.*y.^4+~~~~~~ % <-- Note the use of .* and .^ instead of just * and ^
4 件のコメント
Junsoo Lee
2015 年 3 月 26 日
James Tursa
2015 年 3 月 26 日
So now it sounds like your primary question is one of solving an equation for y in terms of x, and a secondary question is how to plot the solution for a range of x. Is this correct?
So far you have listed two different equations:
x*(y^4+y)=0
and
x*y^4+y^2=0
What is it exactly that you are trying to solve?
Junsoo Lee
2015 年 3 月 26 日
Junsoo Lee
2015 年 3 月 27 日
この質問は閉じられています。
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!