how do i display two arrays using disp in two colomns in matlab

You can use the disp function along with cell arrays to display two arrays in two columns in MATLAB. Here's an example:

main.m
array1 = [1, 2, 3, 4, 5];
array2 = [6, 7, 8, 9, 10];

combinedArray = {array1.', array2.'};  % Using .' to make arrays into columns

disp(combinedArray)
153 chars
7 lines

In this code, array1 and array2 are two arrays that you want to display in two columns. By creating a cell array combinedArray with array1.' and array2.' as elements, you can then use disp to display these two arrays in two columns.

related categories

gistlibby LogSnag