Plotting a giant surface exceeding array limitations

6 vues (au cours des 30 derniers jours)
Robert Scott le 3 Déc 2023
Commenté : Robert Scott le 4 Déc 2023
Hi all
I have a need to plot a large surface.
Im trying to create a multi dimensional array.
Picture the following.
A typical X and Y plot that is a vector that has 40,000 data points. If you plot that you get a simple traditional XY graph.
Now, i have say 100 of the X and Y vectors and want to plot them all as a surface.
I tried something like this to build the array first. According to the matlab documentation the 3rd variable is like a page variable. Which is exactly what i need.
So to start i just tried
test = zeros(40,000,40,000,100)
And i got an error saying that my array will take 775 gig of space lol
So how does one go about doing this?
Thanks
1 commentaireAfficher -1 commentaires plus anciensMasquer -1 commentaires plus anciens
Robert Scott le 3 Déc 2023
I looked into that but there are very poor examples for tall arrays mostly using data that already exists in some file.

Connectez-vous pour commenter.

Réponse acceptée

Matt J le 3 Déc 2023
Modifié(e) : Matt J le 3 Déc 2023
First of all, you should consider downsampling from 40000 points to perhaps 400. Having very dense data beyond a certain point will not help you better visualize the surface.
Aside from that, though, your surface will have 40000*100 points, so a trisurf plot would only require you to form 40000x100 arrays.
[Xsurf,Ysurf,Zsurf]=deal(zeros(4e4,100)); %pre-allocate
20 commentairesAfficher 18 commentaires plus anciensMasquer 18 commentaires plus anciens
Matt J le 4 Déc 2023
How can i get this to work with just a simple meshgrid.
I don't think you can, because in your original problem description, your X,Y data is scattered, not gridded. Ifthat's no longer the case, it would seem that you have a whole new problem and you should accordingly post a whole new question.
Robert Scott le 4 Déc 2023
Thanks, Matt
Well, i have no idea how it works but it works.
I basically just took 3 giant vectors X,Y and T and put them in the surf command and it worked.
This turned out to be a total waste of a day sadly. My misinterprestation of the data set really screwed me up and caused me to write many nonsensical scripts.
In the end, your original solution or my cell array solution would work for something like this.
I thank you for your persistance in helping me esepcailly on a sunday.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Annotations dans Help Center et File Exchange

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by