Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Suppressing result using 'varname_' in Matlab

  1. Mar 2, 2012 #1
    Hey everybody
    I have very recently learned the function 'varname_' for storing data with different names in a loop. My problem is that the result is written in the command window even though I have written ;.

    My command looks like this

    for run=237:273
    [F,dt] = Dataimport(n,run);
    eval(['F_' num2str((run-237)*10) '=F']);
    clc
    end

    Since every F comming out of the function Dataimport is a 10x33,877 matrix I would very much like to stop Matlab from writing it 37 times (length of loop).

    I have tried putting two ;; but that gave an error. Right now I'm just deleting the result for each loop but it still takes a lot of unnecessary power.

    Can anyone help me and correct my mistake?

    Regards Heidi
     
  2. jcsd
  3. Mar 6, 2012 #2
    How should I interpret the lak of response? Is it because you don't know how to solve the problem, maybe because this is just how Matlab has decided to do it, or because you cannot see why I'm even having this proplem?
    Please let me know this as my script is increasing with more of these huge loops with new variables.
    Regards Heidi
     
  4. Mar 7, 2012 #3
    Instead of:

    Try:

    Note the ; after F.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Suppressing result using 'varname_' in Matlab
Loading...