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

Abstracting info out of the filename and updating it

  1. Dec 14, 2009 #1
    Following a similar problem that was posted....

    I have data , which consists of 3 columns related to 3 parameters H, T and E (Height, period and efficiency) and herewith, I would like to create a scatter diagram.

    the name of every cell would carry the name of the H and T parameter and that 'cell' should contain different efficiencies...

    So:
    - I managed to create a name for all these cells e.g.: Cell_H_T
    for h=1:10
    for t=1:10
    eval(['Cell_' num2str(h) '_' num2str(t) '=[0]']);
    end
    end

    Now:
    - how can I adress every matrix individually?
    In the next example, the number '1' (appearing in t1min) should also change in between each loop.
    e.g.: I analyse the data and if the data follows the requirements I would like to add that value into the cell_H_T... and also count the number of datapoints in there countCell_H_T
    (this off course doesn't work)
    for h=1:10
    for t=1:10
    for k = 1:length(H)
    if (T(k)>=t1min & T(k)<=t8max) & (h1min<=H(k) & H(k)<=h10max)
    Cell_ num2str(h) _ num2str(t) = [Cell_ num2str(h) _ num2str(t);E(k)]
    countCell_ num2str(h) _ num2str(t) = countCell_ num2str(h) _ num2str(t) + 1;
    end
    end
    end
    end

    Many thanks in advance for your help!!
     
  2. jcsd
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Can you offer guidance or do you also need help?
Draft saved Draft deleted