Plotting Smith Chart on MATLAB - Error

1 回表示 (過去 30 日間)
Ammar Babikir
Ammar Babikir 2017 年 8 月 10 日
コメント済み: Ammar Babikir 2017 年 8 月 10 日
Hi everybody,
I am trying to plot a Smith chart on MATLAB. I am familiar with MATLAB but not when it comes to anything concerning with RF/Smith Chart plotting.
I am trying to plot a Smith chart with a 150 - 200j point plotted on it.
This is the error that I am getting:
Attempt to execute SCRIPT smithchart as a function: C:\Users\Ammar\Documents\MATLAB\smithchart.m Error in smith_ch_calc (line 3) sm1=smithchart;
I copy/pasted the code directly from someone who previously answered the question to a similar question that I had.
Here is the code:
clc;clear all;format long;
Z0=100;
sm1=smithchart;
ZL1=150-1j*200;f0=3e9; % Hz
gamma_L=(ZL1-Z0)/(ZL1+Z0);
% show ZL1 on Smith chart adding text showing values
if imag(ZL1)<0
sign1='-';
else
sign1='+';
end
hold all;plot(real(gamma_L),imag(gamma_L),'ro','LineWidth',1.5);
str1=['ZL =' num2str(real(ZL1)) sign1 'j' num2str(abs(imag(ZL1))) ' \rightarrow'];
text(real(gamma_L),imag(gamma_L)+.01,str1,'Color','blue','FontSize',20,'HorizontalAlignment','right','VerticalAlignment','middle');
end
  1 件のコメント
KSSV
KSSV 2017 年 8 月 10 日
The code is working fine.....in my pc..what does which smithchart gives?

サインインしてコメントする。

採用された回答

Walter Roberson
Walter Roberson 2017 年 8 月 10 日
The file C:\Users\Ammar\Documents\MATLAB\smithchart.m is not the Mathworks supplied smithchart.m file. You have your own smithchart.m file that is interfering with calling the Mathworks function.
For example this could happen if you had stored the code you posted in C:\Users\Ammar\Documents\MATLAB\smithchart.m
  1 件のコメント
Ammar Babikir
Ammar Babikir 2017 年 8 月 10 日
Yes it worked! I had to delete the other files that I had stored with that name. Thank you!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeVisualization and Data Export についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by