how do i make my function accept filename as input ?
Afficher commentaires plus anciens
hi, i have a function that i want to accept an excel filename as an input so it can load that file, i have been unable to get it to accept that , ive tried using filename as an input
function [ theta , xLand ] = ProjectileData(fileName)
%UNTITLED8 Summary of this function goes here
% Detailed explanation goes here
data = xlsread('fileName');
theta = data(:,1);
xLand = data(:,2:end);
aveDis = mean(xLand , 2);
if nargout == 0
plot (theta , aveDis)
end
end
1 commentaire
per isakson
le 15 Fév 2017
Why do you think the function does not accept the filename?
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Workspace Variables and MAT Files dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!