Creating a profile of 2D array

Hi everyone.
If I have a 2D matrix (1000,1000) and I want to know for example the index od the point (3.6,100), how can I do this?
If I know theses value I can plot this profile indexing my matrix.
Anyone have other ideia of how can I do it?
For everyone to better understand my problem, here's my code:
And I want to criate profiles of Q along that figure.
if you can help me I appreciate it very much.
wc = 2e8;
einf = 2;
es=linspace(0.1,22,1000);
tau =linspace(7e-12,100e-12,1000);
deltae = es-einf;
for i = 1:1000;
for j = 1:1000;
Q(i,j)= ( einf + ( deltae(i) )/( 1 + (wc^2) * (tau(j).^2 ) ))/((deltae(i) * (tau(j)) *wc )/( 1 + (wc^2) * (tau(j).^2)));
end
end
contour(deltae,tau,Q,[10;20;50;70;100;200;300;400;500;600;700;800;900;1000;2000]);

2 Comments

Each element in the 2D matrix is a single element. What does (3.6,100) represent?
Represents a cartesian point. I want to get the index matrix of this point.

Sign in to comment.

Answers (1)

I hope you have X, Y, Z matrices of size specified. And you want to know the value at given point (x,y). IN that case you need to use interp2.
iwant = interp2(X,Y,Z,3.6,100) ;

1 Comment

In this case the cartesian point is, for example, (3.6, 100). I had written wrong. I'm sorry.
But the question is, how can I get the matrix index of these cartesian point ?
Thank you.

Sign in to comment.

Categories

Find more on Language Fundamentals in Help Center and File Exchange

Asked:

on 17 Oct 2020

Edited:

on 17 Oct 2020

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!