Creating a profile of 2D array
Mostra commenti meno recenti
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 Commenti
Ameer Hamza
il 17 Ott 2020
Each element in the 2D matrix is a single element. What does (3.6,100) represent?
Bruno Barauna
il 17 Ott 2020
Risposte (1)
KSSV
il 17 Ott 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 Commento
Bruno Barauna
il 17 Ott 2020
Categorie
Scopri di più su Language Fundamentals in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!