Lookup Table of 1*2

1 visualizzazione (ultimi 30 giorni)
Bilal Mustafa
Bilal Mustafa il 25 Feb 2018
Commentato: Image Analyst il 25 Feb 2018
If I have a 2D Lookup table having x and y inputs with dimension of 1*15 each and output z of 15*15, how can i reverse it in a way that I have z as input and x and y as outputs? What should be the dimensions now for i/p and o/p?

Risposte (1)

Image Analyst
Image Analyst il 25 Feb 2018
Try interp2().
  8 Commenti
Bilal Mustafa
Bilal Mustafa il 25 Feb 2018
Well with contour(), I haven't tried yet. I just thought to clarify my question if its not. I'll try with contour and come again, if any problem. Thanks a lot.
Image Analyst
Image Analyst il 25 Feb 2018
See this code:
x= [0:1:15]
y= [0:1:15]
% Make a 1-D vector (for some reason).
z = randi(100, 1, length(y) * length(x))
% Now immediately turn it into a 2-D matrix
Z = reshape(z, length(y), length(x))
subplot(1, 2, 1);
contour(Z)
title('Random Data', 'FontSize', 20);
subplot(1, 2, 2);
p = peaks(400);
contour(p);
grid on;
title('Peaks Function', 'FontSize', 20);
Each contour line is a line of some constant Z value. Not sure what Z value you want, but the point is that, that Z may show up in lots of places.

Accedi per commentare.

Categorie

Scopri di più su Cell Arrays in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by