display result 1 & result 2 in matlab

To display two results in MATLAB, you can use the fprintf function to print the results to the command window.

Here's an example:

main.m
result1 = 10;
result2 = 20;

fprintf('Result 1: %d\n', result1);
fprintf('Result 2: %d\n', result2);
101 chars
6 lines

This will display the values of result1 and result2 as follows:

main.m
Result 1: 10
Result 2: 20
26 chars
3 lines

You can replace the values 10 and 20 with your desired variables or expressions.

Note: If you want to display the results in a graphical form, you can use MATLAB's plotting functions such as plot, scatter, or imshow, depending on the type of data you have.

related categories

gistlibby LogSnag