I'm unable to figure out this error ''too many input arguments"

4 ビュー (過去 30 日間)
naheeda reshi
naheeda reshi 2023 年 5 月 7 日
編集済み: Dinesh 2023 年 6 月 6 日
clear all; close all;
clc;
t=[0:1:10];
x=[2:2:20];
rbw = 75e3;
FrOffset = [100e3 300e3 500e3 1e6 3e6 10e6];
PNTarget = [-130 -140 -135 -130 -140 -155];
[PNMeasure] = phaseNoiseMeasure(t,x,rbw,FrOffset,'on','Phase noise',PNTarget,'Type','Time','Histogram','off')
plot(FrOffset,PNMeasure);
  2 件のコメント
naheeda reshi
naheeda reshi 2023 年 5 月 7 日
Error using phaseNoiseMeasure
Too many input arguments.
Error in pn_meas (line 8)
[PNMeasure] = phaseNoiseMeasure(t,x,rbw,FrOffset,'on','Phase
noise',PNTarget,'Type','Time','Histogram','off')
dpb
dpb 2023 年 5 月 7 日
編集済み: dpb 2023 年 5 月 7 日
t=[0:1:10];
x=[2:2:20];
whos t x
Name Size Bytes Class Attributes t 1x11 88 double x 1x10 80 double
t=[1:1:10];
rbw = 75e3;
FrOffset = [100e3 300e3 500e3 1e6 3e6 10e6];
PNTarget = [-130 -140 -135 -130 -140 -155];
[PNMeasure] = phaseNoiseMeasure(t,x,rbw,FrOffset,'on','Phase noise') % Try the shortest list given as inputs...,PNTarget,'Type','Time','Histogram','off')
Index in position 2 exceeds array bounds.

Error in phaseNoiseMeasure (line 206)
PnReal=interp1(PhaseNoisePn(:,1),PhaseNoisePn(:,2),FrOffset);
[PNMeasure] = phaseNoiseMeasure(t,x,rbw,FrOffset,'on','Phase noise',PNTarget,'Type','Time','Histogram','off')
plot(FrOffset,PNMeasure);
Get different error -- first compained that t,x weren't same length so fixed that as shown, then the above.
I have no idea what the function is trying to do so no real klew about where the interpolation issue might be coming from...
In just reading the input description, it seems to meet the syntax definition
[PNMeasure] = phaseNoiseMeasure(t,x,rbw,FrOffset,'on','Phase noise') % Try the shortest list given as inputs...,PNTarget,'Type','Time','Histogram','off')
The first input form you gave erred trying to use griddedinterpolant internally on a dimension mismatch of needing multiple dimensions. So, I cut the input down to the minimal number of inputs given in the documentation and then it aborted as above trying to use interp1. As noted, since I've no klew what the function is trying to do, I don't hve any idea what it's trying to interpolate over, but my initial guess of your specific input problem is that the magnitude of the phase frequencies of the input signal, being just a straight line aren't commensurate with the requested values you've asked for in the otherr inputs and the function just isn't robust-enough to handling nonsensical inputs to catch the issue.
I couldn't reproduce your initial question error with the input case you provided, however...
My suggestion would be to go back to using one of the sample datasets and learn how to use the function with them and the given examples in the doc, then use real-world data (or at least some made up that will have real frequency components in it in the ranges expected by the analysis and results will likely be much better.

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

回答 (1 件)

Dinesh
Dinesh 2023 年 6 月 6 日
編集済み: Dinesh 2023 年 6 月 6 日
Hi Naheeda!
I tried reproducing the issue on my side. The arrays ‘t’ and ‘x’ should be of the same dimension here ‘t’ is of dimensions 1 * 11 and ‘x’ is of dimensions 1 * 10. So, that must be changed. I am not getting the too many input arguments error as the input arguments for the function phaseNoiseMeasure are correct.
Now running phaseNoiseMeasure will prompt an interpolation error and this is about not having enough sample points to perform the interpolation operation. So, increase the number of sample points. After using the following ‘x’ and ‘t’ the function will work.
x = rand (1,100,'double');
t = linspace (1,2, 100);
Please refer to the following MATLAB documentation regarding examples on phase noise profile from time domain signal.
For details about ‘linspace’ and ‘rand’ functions refer the following MATLAB documentations
hope this helps,
Thank you!

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by