Get specific elment of result / solution vector
Info
This question is closed. Reopen it to edit or answer.
Show older comments
Hi, is there a way to get the last element of the result-vector of some calculation? E.g.: I want to solve a system of linear equations and get the last element of the solution. I could write
temp = A\b;
x = temp(end);
but I want to do that with only one line of code. I tried things like
x= [A\b](end);
but they didn't worked out...
Thanks!
Answers (1)
Azzi Abdelmalek
on 6 May 2016
If you want it in one line
temp = A\b;x = temp(end);
Otherwise you can't do it
This question is closed.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!