Lookup Table of 1*2
    조회 수: 4 (최근 30일)
  
       이전 댓글 표시
    
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?
댓글 수: 0
답변 (1개)
  Image Analyst
      
      
 2018년 2월 25일
        Try interp2().
댓글 수: 8
  Image Analyst
      
      
 2018년 2월 25일
				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.
참고 항목
카테고리
				Help Center 및 File Exchange에서 Cell Arrays에 대해 자세히 알아보기
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

