Creating a density plot out of a large matrix in octave

17 views Asked by At

I'm trying to create a density plot with a file I have been given, where the matrix is a 663 x 676 grid that shows the height at points across a physical piece of silicon. I am supposed to use this matrix to construct a picture of the silicon's surface.

I am trying to create a 3d image of the surface of the silicon using the code:

clear all
fid = fopen(filename, 'r');
data = fscanf(fid, '%f');
A = reshape(data, 663,676);
M = 1:663;
N = 1:676;
Z = A(M,N);
mesh(M,N,Z)

It gives me: error: surface: rows (Z) must be the same as length (Y) and columns (Z) must be the same as length (X) error: called from surface>surface at line 136 column 11 surface at line 68 column 21 mesh at line 84 column 12 M1Q1 at line 8 column 1

What can I do to make it work, to display a 3d map of the silicon's surface?

0

There are 0 answers