Good day! I am experiencing difficulties creating an array to use for plotting: you see, I've created my variable array - the "x" of the whole plotting operation, but now I'm trying to plug that into my function and it's not resulting in a new array, just a scalar output. I've tried adding dots to just about every operator, doesn't seem to do a whole lot of good.
Here are the relevant lines of my code:
R1=10^4:100:5*10^5;
R2=10^3;
C=10^-10;
w=13.56*10^6;
Z=sqrt(((R1.*R2).^2+(R1./(w*C)).^2)/((R1+R2).^2+1/(w*C)^2));
And that last line is the problem. I can't seem to get it to form an array! I would greatly appreciate any advice on the matter.

 채택된 답변

Stephen23
Stephen23 2018년 7월 29일
편집: Stephen23 2018년 7월 29일

0 개 추천

Z = sqrt(((R1.*R2).^2+(R1./(w*C)).^2)./((R1+R2).^2+1/(w*C)^2));
^^ you need to use RDIVIDE, not MRDIVIDE!
Read about the differences here:

댓글 수: 2

Boris Raskolnikov
Boris Raskolnikov 2018년 7월 29일
Hawk's eyes you've got! Thank you very much, I will be reading the articles for bedtime tonight. Seems to me, the way to go is to just plop dots on every questionable operator until I get better at the language!
Stephen23
Stephen23 2018년 7월 30일
"Seems to me, the way to go is to just plop dots on every questionable operator until I get better at the language!"
If you are not doing linear algebra then use the dots.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기

제품

릴리스

R2016a

태그

질문:

2018년 7월 29일

댓글:

2018년 7월 30일

Community Treasure Hunt

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

Start Hunting!

Translated by