How to find a value from column 1 for given column 2 and 3 values.
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi there, new to Matlab and have a small task which I need help with.
I have three columns, first shows velocity, second shows x-coordinates and third shows y-coordinates. I want to be able to find the velocities for given x,y coordinates. I have about 36,000 values for each so basically need an efficient way to do this. Thanks in advance.
3 Kommentare
Antworten (2)
Matt J
am 1 Sep. 2018
Use griddedInterpolant
F=griddedInteprolant({x,y},velocity);
2 Kommentare
Matt J
am 2 Sep. 2018
Bearbeitet: Matt J
am 2 Sep. 2018
There are several options for that which are explained in the griddedInterpolant documentation, but in this example, I intended x and y to be grid vectors.
Yes, you should give the velocity data to griddedInterpolant in matrix form, using reshape() appropriatately. If the velocity data is not sampled from a regular grid, you should probably be using scatteredInterpolant() instead.
ahmed nebli
am 1 Sep. 2018
Bearbeitet: ahmed nebli
am 1 Sep. 2018
u can use a code like this
% A is you matrix for i=1:size(A,1) y(i)=A(i,1); %the volocity for each x , y end
1 Kommentar
Siehe auch
Kategorien
Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!