Help with loading data into a table based on location pairs?
1 次查看(过去 30 天)
显示 更早的评论
Greetings all,
Here's what I am trying to do. I have 4 columns of 16 values (observation points), and I am trying to make calculations based on these values to put into a table so that I can save it in .dat format. So there are two concepts I am having trouble with:
1.) Making computations based on location pairs of these observation points (Major problem) and
2.) Saving required information into .dat (Minor issue).
Allow me to explain item 1. Pick the first value out of the first column and call that location A. Then compare it to all of the other values (including itself), such that Location A, in a numerical element sense, will always be Location A =1, and Location B will be 1,2,3,4,5,6...16, and then again 1,2,3,4...16 (4 times total). I'll then have to use the observation values to make my calculations. There will be 64 total comparisons. All results I'll need to put into a table in .dat format
Here's the code I have so far (again not complete and I know I am wrong but I am trying, and admittedly stuck):
%This is the array of 4 columns by 16 values - .dat
sigmaarray = [EM31CondMidSwathWest, EM31CondMidSwathEast, GSSICond10kHzMidSwathEast, GSSICond10kHzMidSwathWest];
n=1;
for i=1:length(sigmaarray)
for j=1:4
Location_a(n)=numel(sigma_a_vector(1));
Location_b(n)=numel(length(sigmaarray));
n=n+1;
end
end
n=n-1;
Location_a_vector = Location_a';
My current problems are the "Location_b" is one by 1x64 of all 1's, but it needs to be 64 x 1 of 1,2,3,4...16, and repeat that pattern 4 times total. Location_a_vector is fine.
The only other thing that I am stuck on is how to actually use the values in these sense to make calculations. For instance, Location_a, element wise is always going to be "1", but the actual value is 194.25. So I need to use that value and the values located within location_b to make my calculations.
Any ideas? Do I have the right approach or am I way off?
Thanks! -J
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!