Plotting a function from the Communication toolbox in App designer

2 Ansichten (letzte 30 Tage)
tyler seudath
tyler seudath am 15 Mär. 2021
Beantwortet: Monisha Nalluru am 19 Mär. 2021
Hi Everyone,
I am trying to plot a rician impulse and frequency response in App designer and the simulated object image is not staying on the screen. Can someone assist please, this is the code below:
x= (app.ExcessDelayField.Value);
y =(app.RelativePowerdBmEditField.Value);
xconverted=str2double(strsplit(x,','));
yconverted=str2double(strsplit(y,','));
if (not((length(xconverted)==length(yconverted))))
fig = uifigure;
uialert(fig,'Error! Both parameters must have the same amount of values!','Re-enter parameters!');
else
% stem(app.Plot1,xconverted,yconverted);
% app.Plot1.YDir = 'reverse';
% xlabel(app.Plot1,'Excess tap delay');
% ylabel (app.Plot1,'Relative power (dB)');
% title(app.Plot1,'Power Delay Profile');
Carrierfrequency_Hz =app.CarrierFrequencyMHzEditField.Value*1e6;
Mobilespeed_ms=(app.MobilespeedkmhrEditField.Value*1000)/3600;
fD= (Carrierfrequency_Hz )*(Mobilespeed_ms)/(3e8); %dopplershift= Mobile_speed * Carrier frequency /speed of light
samplerate=app.SamplerateMHzEditField.Value*1e6;
pathdelays=xconverted*1e-9;
% release(rayChan);
ricianChan = comm.RicianChannel('SampleRate',samplerate, ...
'PathDelays',pathdelays, ...
'AveragePathGains',yconverted, ...
'KFactor',10, ...
'MaximumDopplerShift',fD, ...
'Visualization','Impulse response');
x1 = randi([0 1],1000,1);
y1=ricianChan(x1);

Antworten (1)

Monisha Nalluru
Monisha Nalluru am 19 Mär. 2021
The ricianChan function doesnot support passing axes or uiaxes as input.
As workaround you can use the data from ricianChan and plot accordingly by targeting the axes in the app designer.

Kategorien

Mehr zu Develop Apps Using App Designer finden Sie in Help Center und File Exchange

Produkte


Version

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by