- We have no idea what ‘a’, ‘b’, ‘c’, and ‘f’ are or how you define them;
- You could replace your separate ‘R’ lines with: R(i,:) = [a b c f];
how to display the outputs
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Dear All,
I have problem to display my outputs from this function when I call it from another file drawbox(5)
function [Matrix] = drawbox(n)
R=zeros(5,3);
for i=1:n
R(i,1)=a;
R(i,2)=b;
R(i,3)=c;
R(i,4)=f;
end
R;
sortedR= sortrows(R,4);
Matrix= sortedR(:,1:3);
end
I don't know what is the problem.
3 comentarios
Star Strider
el 19 de Oct. de 2014
It would give the same result, just more efficiently.
- We still have no idea what ‘a’, ‘b’, ‘c’, and ‘f’ are, or how you define them;
Respuestas (1)
the cyclist
el 19 de Oct. de 2014
Editada: the cyclist
el 19 de Oct. de 2014
You could use the disp or sprintf command to have more control over what you see.
1 comentario
Image Analyst
el 19 de Oct. de 2014
And fprintf() if you want to go to a file or the command window.
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!