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?

Respuestas (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

Categorías

Más información sobre 2-D and 3-D Plots en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 22 de Feb. de 2018

Respondida:

el 22 de Feb. de 2018

Community Treasure Hunt

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

Start Hunting!

Translated by