Hi there,
I have 134 .mat files (sessions). Each file (session) contains 10 stations. Each station contains 24 values (hourly value) for each file. I need to extract those values from 134 .mat files. I use loop, however, matlab always shows "Unable to perform assignment because the indices on the left side are not compatible with the size of the right side."
if loadf==1 for ip = 1: ns % number of sessions
nstat = length(x_.antenna); sres = std(res.mainVal); for k = 1:nstat stnam = x_.antenna(k).name; if strcmp(stnam,'KATH12M ')||strcmp(stnam,'HART15M ')||strcmp(stnam,'YARRA12M')||strcmp(stnam,'HOBART26')||strcmp(stnam,'WARK12M ')||strcmp(stnam,'ONSALA60'); if strcmp(stnam,'KATH12M ') id = 1; mjd_KATH(ip) = x_.zwd(k).mjd; zwd_KATH(ip) = x_.zwd(k).val; dzwd_KATH(ip) = x_.zwd(k).mx; end if strcmp(stnam,'HART15M ') id = 2; mjd_HART(ip) = x_.zwd(k).mjd; zwd_HART(ip) = x_.zwd(k).val; dzwd_HART(ip) = x_.zwd(k).mx; end if strcmp(stnam,'YARRA12M') id = 3; mjd_YARRA(ip) = x_.zwd(k).mjd; zwd_YARRA(ip) = x_.zwd(k).val; dzwd_YARRA(ip) = x_.zwd(k).mx; end if strcmp(stnam,'HOBART26') id = 4; mjd_HOBART(ip) = x_.zwd(k).mjd; zwd_HOBART(ip) = x_.zwd(k).val; dzwd_HOBART(ip) = x_.zwd(k).mx; end if strcmp(stnam,'WARK12M ') id = 5; mjd_WARK(ip) = x_.zwd(k).mjd; zwd_WARK(ip) = x_.zwd(k).val; dzwd_WARK(ip) = x_.zwd(k).mx; end if strcmp(stnam,'ONSALA60') id = 6; mjd_ONSA(ip) = x_.zwd(k).mjd; zwd_ONSA(ip) = x_.zwd(k).val; dzwd_ONSA(ip) = x_.zwd(k).mx; end end end endend
Best Answer