How to create a row/column vector of variable length composed of x1,x2,x3,...,xN
Mostrar comentarios más antiguos
I have a column vector, x, of solutions for the equation ax=b, length of x = N, and I want to label which solution is which. N varies depending on the size of the matrix inputted into the function. Want a new vector in the form of xsol = [labels,x] because when you get around 1000 solutions it's not so easy to see what the solutions correspond to. Any help would be greatly appreciated!
3 comentarios
the cyclist
el 25 de Nov. de 2017
Can you give an example (maybe for just x1,x2) of what inputs and outputs? Ideally, don't just describe them -- use MATLAB syntax to define them.
Timothy Corley
el 25 de Nov. de 2017
Birdman
el 26 de Nov. de 2017
Check my answer.
Respuesta aceptada
Más respuestas (1)
Image Analyst
el 26 de Nov. de 2017
What is x1, x2, etc.? Do you mean x(1), x(2), etc.????? Otherwise you need to define x1 x2, etc. If it's x(1), x(2), etc. then
labels = x
and xsol is
xsol = [labels, x];
Not sure what good they are, but that's what you asked for.
Categorías
Más información sobre Common Operations en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!