converting a vector to matrix
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Charlotte Reed
el 27 de Feb. de 2020
Comentada: Walter Roberson
el 28 de Feb. de 2020
I'm doing practice questions, and I am stuck. If the vector is x=[9,4,0,7] and i want to create a Matrix with 4 rows (the original vector, the recipricol, the factorial of the originals using my own code i already wrote, and the factorial using matlab's factorial function) while also putting ruler lines above and below the outputs. How the heck does one do this?
0 comentarios
Respuesta aceptada
David Hill
el 28 de Feb. de 2020
Not sure if this is what you are after, but it could be a starting point. Not sure what you mean by ruler lines above and below.
y=[x;1./x;factorial(x)];
10 comentarios
Walter Roberson
el 28 de Feb. de 2020
fprintf('------------- ------------- ----------- ------------\n')
fprintf('%13.5f %13.5f %13.5f %13.5f\n', M');
fprintf('------------- ------------- ----------- ------------\n')
The choice of 13.5f is speculation on my part: you will want to play around with the .5 part.
Más respuestas (0)
Ver también
Categorías
Más información sobre Line Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!