Effacer les filtres
Effacer les filtres

Data plot for different values

1 vue (au cours des 30 derniers jours)
University Glasgow
University Glasgow le 14 Sep 2022
Modifié(e) : Torsten le 14 Sep 2022
I want plot theta as a function of z at t = time(nt) for all xi values but receive: Error using plot: Data cannot have more than 2 dimensions om line 140.

Réponse acceptée

Torsten
Torsten le 14 Sep 2022
%store your outputs for each xi
thetaxivalues(ixi,:,:) = theta(:,:);
vxivalues(ixi,:,:) = v(:,:);
What is ixi ? I guess, it's a single scalar, namely ixi = nxi from the last loop where ixi appears:
for ixi = 1:length(xivalues)
xi = xivalues(ixi);
end
So you don't store outputs for each xi.
  8 commentaires
University Glasgow
University Glasgow le 14 Sep 2022
If you cehck the discretised equations, I have xi in the v equation.
Please check, you will see: (xi/(2*h))*(theta(N-1)-theta(N-3));
Torsten
Torsten le 14 Sep 2022
Modifié(e) : Torsten le 14 Sep 2022
Then call the solver in a loop over the elements of xi and write the results in a 3d v and theta array.
But that's really standard and I won't do that for you.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur MATLAB dans Help Center et File Exchange

Produits


Version

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by