I am have this problem, when click run the prog. the prog. asked me to enter the input argument by typing it?

2 visualizaciones (últimos 30 días)
function importfile1(fileToRead1)
%IMPORTFILE1(FILETOREAD1)
% Imports data from the specified file
% FILETOREAD1: file to read
% Auto-generated by MATLAB on 28-Feb-2020 12:29:05
% Import the file
newData1 = load('-mat', fileToRead1);
% Create new variables in the base workspace from those fields.
vars = fieldnames(newData1);
for i = 1:length(vars)
assignin('base', vars{i}, newData1.(vars{i}));
end

Respuestas (1)

Walter Roberson
Walter Roberson el 28 de Feb. de 2020
You cannot run that code just by clicking on the green Run button. You need to call it from code, or you need to go to the command line and invoke it by name passing in the file name.
Data = importfile1('sixofhearts.txt');
for example.

Categorías

Más información sobre Calendar en Help Center y File Exchange.

Productos


Versión

R2014a

Community Treasure Hunt

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

Start Hunting!

Translated by