現在この質問をフォロー中です
- フォローしているコンテンツ フィードに更新が表示されます。
- コミュニケーション基本設定に応じて電子メールを受け取ることができます。
how to solve this error
1 回表示 (過去 30 日間)
古いコメントを表示
Redflower
2019 年 2 月 24 日
I got this error Subscript indices must either be real positive integer or logical
I am tried to removed the range of desired signal from dataset matrix and find the power of that range. then the remaining will be interferance and also i want to find the power of remaining range
the error occured when i want to find the power of interferance
PI=mean(mean(SysSetup.Dataset(:,RI).^2))
this is my code
25 件のコメント
Geoff Hayes
2019 年 2 月 24 日
Redflower - so the code is failing at the 7th or 8th line? What can you tell us about RI? i.e. what are the values of this array? Are they positive integers or (as the error message suggests) something else?
Walter Roberson
2019 年 2 月 24 日
When you use linspace() you should assume that you are going to get back values that are not necesarily positive integers. If you need positive integers, it is safer to use the colon operator, probably in conjunction with floor() or ceil().
Perhaps in your case it would be sufficient to index at round(RI) instead of at RI .
Redflower
2019 年 2 月 25 日
dear Goff
the error in line 10 and the matlab file which i use to find the result
a

Walter Roberson
2019 年 2 月 25 日
You attach code but not sysSetup or the other variables needed for us to run the code to test.
Walter Roberson
2019 年 2 月 25 日
It looks like it is necessary to call
ModDatasetGenpaper; %to define SysSetup
Train_cumulantpaper; %to define net
something unknown at this point %to define ModIdentdataset
AccuVsSIR2cum; %to do computation
Unfortunately without the code to define ModIdentdataset it is difficult for us to test.
Redflower
2019 年 2 月 25 日
what you are saying correct
i attached again the all codes. and let me to know if they work
Walter Roberson
2019 年 2 月 25 日
Okay, finally I can reproduce your error.
You copy the test dataset into RI and you delete the columns given by Rd (a list of positive integers) from that. The result is a 2D numeric array of floating point data with fewer columns that the test dataset.
You then try to index sysSetup.Dataset() using that floating point dataset as indices.
I suspect you want to instead take
RI = setdiff(1:size(Dataset_test,2), Rd);
That is, I suspect you want RI to be the list of remaining indices.
Redflower
2019 年 2 月 26 日
the code you give is work but again matlab give me an error on line 16
matrix dimensions must be agree
Walter Roberson
2019 年 2 月 26 日
Ah, yes, if RI is not the same length as Rd then line 16 would trigger an error.
I cannot suggest any solution due to the lack of documentation about what Rd and RI are intended to represent.
Redflower
2019 年 3 月 3 日
thank you for your response
I try to solve the problem but tell now I didn't get
Walter Roberson
2019 年 3 月 3 日
I do not know. If I had documentation about what Rd and RI should mean, then I might be able to assist.
Redflower
2019 年 3 月 4 日
I work on digital modulation classification. I have seven classes each class has 1000 signal. at training phase, I use dataset of 7000 signals to built classifier (these signals without any effect of noise). at testing phase i want to test the classifier when there is interference.Also, i use dataset of 7000 signals.
for more details:
class Range
class 1 ( 2-ASK 1- 1000)
class2 (4-ASK 1001-2000)
class3 (2-PSK 2001-3000)
class4 (4-PSK 3001-4000)
class5 (8-PSK 4001-5000)
class6 (16-QAM 5001-6000)
class7 (64-QAM 6001-7000)
my task is to find the accuracy of classifier ( when only one class is desired and other will be interference)
Rd present the desired class
RI present the interference classes
Each time I must find the accuracy of desired class vs interference classes at different SIR value ( signal to interference ratio)
Redflower
2019 年 3 月 4 日
yes, that is previous version of code in that cade i find the accuracy of classifier ( when only one class is desired and one class is interfered)
now i want to find the accuracy of classifer when (one class is desired and others will be interference) but I don't know how to modify the code
Walter Roberson
2019 年 3 月 4 日
It is a little after 1 AM where I am. I could go back to examine your code and predict what bugs you might have introduced when you made unknown changes to your code, and then tell you how to correct each of the possibilities... or I could go to bed and check in the morning to see whether you posted your updated code.
Redflower
2019 年 3 月 5 日
i tried this code and the remaining code still same
but it give me an error in line 16
Redflower
2019 年 3 月 5 日
i tried this code and the remaining code still same
but it give me an error in line 16
Redflower
2019 年 3 月 5 日
I tried to to takes more than one class as interference at computation code AccVsSIR2cum ONLY change in
Acc(n)= Test_cumulantpaper(net, SysSetup, 1, [2 6],0)
where 1 is desired class
and 2 and 6 is interference class
Walter Roberson
2019 年 3 月 5 日
What do you think the result from that linspace() shoud be?
Are you expecting a series of consecutive integers? Are you expecting a series of integers with a constant gap between them? Are you trying to "sample" a range of integers at as close as you can get to equal partitions? Are you trying to extract the index numbers of all samples belonging to a particular class when the SysSetup information knows where the class starts and how long it is?
Redflower
2019 年 3 月 5 日
I tried to to extract all sample belonging to particular class when the SysSetup information knows where the class start
for example if i select 2 and 6 [ 2 6]
i expect to take all samples of class 2 from 1001- 2000 and 5001-6000 and put them in one matrix
same if i select 1, 2 ,4 [1 2 4]
i expect to take all sample of class 1 from 1-1000 , 1001-2000 for class 2 and 3001-4000 for class 4 and put all of them in one matrix
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Transmitters and Receivers についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!エラーが発生しました
ページに変更が加えられたため、アクションを完了できません。ページを再度読み込み、更新された状態を確認してください。
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom(English)
アジア太平洋地域
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)