[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: how to use textscan with gnu octave 3.6.2
From: |
brico |
Subject: |
Re: how to use textscan with gnu octave 3.6.2 |
Date: |
Sun, 13 Jan 2013 07:43:10 -0800 (PST) |
hi philip
Thank you very much for your reply it has helped me a lot. i use fgetl
because there are too many header lines (more than 50) and as you said the
number of header lines vary between files.
You can fine an example of the attached -file.
test.txt <http://octave.1599824.n4.nabble.com/file/n4648825/test.txt>
I wrote the code as you said
"B = textscan(fid2, '%f = %s%f%f%f%f%f%s', 'delimiter', ';', 'headerlines',
1);"
and i got the results i was expecting.
Know i need this result to do a bilinear interpolation. The code i wrote is
the following
result = -ones(num_pos, 1);
if strcmp(property(row_id), 'Aktiv') == 1
result(row_id, 1) = (1 - r) * (1 - s) * kf_mat(x0, y0) + ...
(1 - r) * s * kf_mat(x0, y01) + ...
r * (1 - s) * kf_mat(x01, y0) + ...
r * s * kf_mat(x01, y01);
else
result(row_id) = -2;
endif
result
Octave should do a bilinear interpolation just when the canal is 'Aktiv' .
but i think the command strcmp doesn't function this way. on the
command-window i get just "-2 " everywhere. When i write the code this
way,
result(row_id, 1) = (1 - r) * (1 - s) * kf_mat(x0, y0) + ...
(1 - r) * s * kf_mat(x0, y01) + ...
r * (1 - s) * kf_mat(x01, y0) + ...
r * s * kf_mat(x01, y01);
the command -window gives me the right results.
Please do you have an idea how i can use strcmp in this case?
This is the complete code if you need it
Interpolate5.m
<http://octave.1599824.n4.nabble.com/file/n4648825/Interpolate5.m>
Thank you for your help.
--
View this message in context:
http://octave.1599824.n4.nabble.com/how-to-use-textscan-with-gnu-octave-3-6-2-tp4648766p4648825.html
Sent from the Octave - Maintainers mailing list archive at Nabble.com.