Creating a profile of 2D array
Show older comments
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
Ameer Hamza
on 17 Oct 2020
Each element in the 2D matrix is a single element. What does (3.6,100) represent?
Bruno Barauna
on 17 Oct 2020
Answers (1)
KSSV
on 17 Oct 2020
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
Bruno Barauna
on 17 Oct 2020
Categories
Find more on Language Fundamentals in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!