how to plot a 2d plot colored map?
Afficher commentaires plus anciens
Hello
I am trying to creat a 2d plot colored map, I created two for loops for x=vds and y=vgs, and I calculat z=Ids. but all I got is the last calculated value. thank you 

Réponses (3)
KALYAN ACHARJYA
le 25 Déc 2019
Modifié(e) : KALYAN ACHARJYA
le 25 Déc 2019
Yes,
for vgs=1:1:2
for vds=1:1:2
%....
end
end
As you assigned input gate voltage (vgs) and output drain voltage (vds) in the for loop assignment. During execution it assign a single value only, like 1 or 2, when the loop execution completed it rflects with last value.
See the following example
>> vgs=1:1:2;
>> disp(vgs)
1 2
In for loop
for vgs=1:1:2
%code
end
#Result
>> disp(vgs)
2
Please go through Matlab Basics
ikram zdeg
le 31 Déc 2019
0 votes
1 commentaire
Image Analyst
le 31 Déc 2019
Modifié(e) : Image Analyst
le 31 Déc 2019
What is the size of all the variables on that line? Are any of them vectors? Are all vectors the same length? Are any higher dimensional arrays? Are they all the same size also? If they're arrays or vectors you will have to use .* instead of * if you want element-by-element multiplication rather than matrix multiplication.
ikram zdeg
le 1 Jan 2020
0 votes
1 commentaire
Walter Roberson
le 1 Jan 2020
Use ./ instead of / in each case.
Catégories
En savoir plus sur MATLAB dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

