unrecognized function or variable
8 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Gonzalo Guerrero
il 21 Lug 2020
Modificato: Gonzalo Guerrero
il 21 Lug 2020
Hi all,
I am creating a script to analyse a big file of data imported from a .txt file. The file is a 20223208x8. I used the following code:
Spike2= importdata('ESprematlab3.txt');
Spike=Spike2.data;
function out=Stimulus_output(Spike)
Spike=[Spike]
time=Spike(:,1);
DigiMarker=Spike(:,2);
TMS=Spike(:,4);
ES=Spike(:,5);
RF=Spike(:,7);
force=Spike(:,8);
Muscle1=[];
Time=[];
n=1;
%sample Rate is the Rate that you export the .txt file from Spike.
%Recommended 5000 or more. However, This script is made for 5000. if you
%change it, you may want to also change the MEP or LEP cut below
SampleRate=5000;
%create a Cell with different
Tableresults=cell(n,8);
for
.
.
.
end
out=Tableresults
end
So, what I have tried to achive is getting a Tableresults with different values obtain from the data attaching them.
2 Commenti
Risposta accettata
Walter Roberson
il 21 Lug 2020
You are defining a function inside a script, but you are not calling the function inside the script. Therefore you must be trying to call the function outside of the script. However functions defined inside scripts are local functions, just like functions that are not the first function in a function file are local. You cannot invoke local functions from outside (unless a handle gets exported somehow.)
Save the function to its own file.
1 Commento
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Whos in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!