How to check the output
12 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
atan
am 11 Mär. 2019
Bearbeitet: Kevin Phung
am 11 Mär. 2019
I'm very new to Matlab. I have a code snippet (example) like this;
How to check the output of this function? Sorry for the fundmental question
function A = warmUpExercise()
%WARMUPEXERCISE Example function in octave
% A = WARMUPEXERCISE() is an example function that returns the 5x5 identity matrix
A = [];
% ============= YOUR CODE HERE ==============
% Instructions: Return the 5x5 identity matrix
% In octave, we return values by defining which variables
% represent the return values (at the top of the file)
% and then set them accordingly.
A = eye(5);
% ===========================================
end
0 Kommentare
Akzeptierte Antwort
Kevin Phung
am 11 Mär. 2019
Bearbeitet: Kevin Phung
am 11 Mär. 2019
you've defined the function to be:
function A = warmUpExercise()
so the output is going to be whatever A is defined to be in the function.
because your function takes 0 inputs, just run it on the matlab command line:
warmUpExercise
and you will see it output eye(5)
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Octave finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!