I can't call this function from the command window. The function is meant to output values and plot graphs from a data file.

function [C Gouws,19114656,UTS,E,H,n] = HW1_19114656(filename, Sy)
The error when calling this function is "Error: File: HW1_19114656.m Line: 1 Column: 19 Unexpected MATLAB expression."
How do I call the funtion from the command window and is the function name set correctly?

Réponses (1)

Don't put literal values in the output of a function definition line. Use a variable instead. E.g.,
function [C Gouws,19114656,UTS,E,H,n] = HW1_19114656(filename, Sy)
should be
function [C Gouws,output2,UTS,E,H,n] = HW1_19114656(filename, Sy)
% your code here
output2 = 19114656;
end

Catégories

En savoir plus sur 2-D and 3-D Plots dans Centre d'aide et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by