Effacer les filtres
Effacer les filtres

How to solve a set of equations with a vector as input

2 vues (au cours des 30 derniers jours)
Lu Da Silva
Lu Da Silva le 23 Oct 2020
Commenté : Lu Da Silva le 23 Oct 2020
I have to create a vector P that is made of 50 values ranging from 0 to 2*10^6.
Then I solve 3 equations and need to receive 3 vectors (with 50 values each).
I don't really understand how to do that; this is how I tried:
for P = [0:2e+6:50]
wm = (P/k)^(1/3);
ws = wm / (-1.008);
Ir = sqrt(P/(-0.567);
end
But I only receive one value for each of the 3 equations, not 3 vectors...

Réponse acceptée

KSSV
KSSV le 23 Oct 2020
Modifié(e) : KSSV le 23 Oct 2020
n = 1000 ;
P = linspace(0,50,n) ;
wm = (P./k).^(1/3);
ws = wm / (-1.008);
Ir = sqrt(P/(-0.567); % this will be complex note
  1 commentaire
Lu Da Silva
Lu Da Silva le 23 Oct 2020
I think it's the other way around:
n = 50;
P = linspace(0,2e+06,n);
wm = (P./k).^(1/3);
ws = wm / (-1.008);
Ir = sqrt(P/(-0.567));
But yes I got it, thank you!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Elementary Math dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by