Why i am getting error in printing array?

clc
clear all
close all
a= [1,2,3,4,5,6,7];
b =[12,14,13,15,17,29,21];
c=[];
c= [b;a];
print(c);
I am getting error in printing c. It showing
Error using checkArgsForHandleToPrint
Handle input must be scalar, vector, or cell array of vectors.
Error in checkArgsForHandleToPrint
Error in print>LocalCreatePrintJob (line 216)
handles = checkArgsForHandleToPrint(0, varargin{:});
Error in print (line 38)
[pj, inputargs] = LocalCreatePrintJob(varargin{:});
Error in test1 (line 9)
print(c);
What I want to do is: I want to assign a value to b, when i will sort b value, then according a value will also sort.

1 comentario

sandeep rana
sandeep rana el 22 de En. de 2021
Done, Got the reason why I am getting this error.
Thanks

Iniciar sesión para comentar.

Respuestas (1)

Walter Roberson
Walter Roberson el 22 de En. de 2021

0 votos

print() is for sending graphics to the printer or to a file.
You probably want disp()

1 comentario

sandeep rana
sandeep rana el 22 de En. de 2021
Thanks, unknowingly i am writing python print function in matlab to display matrix.

Iniciar sesión para comentar.

Categorías

Etiquetas

Preguntada:

el 22 de En. de 2021

Comentada:

el 22 de En. de 2021

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by