Prev: Program works fine in debug mode but not in automatic run
Next: Problem with Ascii code to hex code
From: Wei on 24 May 2010 16:46 Hi guys, I just started to use matlab. I got the *out of memory* error while I used the following commands: load out.txt [X,Y]=meshgrid(out(:,1),out(:,2)); Z=griddata(out(:,1),out(:,2),out(:,3),X,Y); surf(X,Y,Z); the out.txt is smaller than 300kb. And I am pretty sure that the memory available is big enough. Although I am not so sure how to check it. It would be great if someone could help me to find it out and solve this problem. Thanks a lot. wei
From: Matt Fig on 24 May 2010 16:55 How many elements are in the 'out' variable? If it is N-by-3, then you should be aware that X,Y,Z are all N-by-N. If N is very large, it is easy to see why you get such an error. You may need to filter, for example: out = out(1:2:end,:) [X,Y] = .... since you surf plot may not need such fine detail if N is very large.
From: Wei on 24 May 2010 19:31 Hi Matt, Thanks for your reply. There are indeed N-by-3 elements in the out. I guess you have pointed out why would I have this problem. But I tried the filter you mentioned like below: load out.txt out = out(1:2:end,:); [X,Y]=meshgrid(out(:,1),out(:,2)); it still gave me the *out of memory* error. Could you help me to figure it out, please? Thank you very much. wei
From: Walter Roberson on 24 May 2010 23:27 Wei wrote: > I just started to use matlab. I got the *out of memory* error while I > used the following commands: > load out.txt > [X,Y]=meshgrid(out(:,1),out(:,2)); > Z=griddata(out(:,1),out(:,2),out(:,3),X,Y); > surf(X,Y,Z); You do not need to create the grid for the purposes of griddata or surf: load out.txt z = griddata(out(:,1),out(:,2),out(:,3),out(:,1),out(:,2)); surf(out(:,1),out(:,2),Z);
From: Wei on 25 May 2010 00:05 Hi Walter, Thanks a lot for your attention. But I think if we want to use mesh or surf, we need to create our meshgrid, as iin regular 2D plot when we want to plot sth against sth, right? Anyway, I tried your way. I just got an empty plot...
|
Next
|
Last
Pages: 1 2 Prev: Program works fine in debug mode but not in automatic run Next: Problem with Ascii code to hex code |