필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

How to apply rules to the attached 729X729 dataset?

조회 수: 1 (최근 30일)
surabhi sachdeva
surabhi sachdeva 2017년 11월 17일
마감: MATLAB Answer Bot 2021년 8월 20일
I have got 729X 29 dataset. Now, I am trying to apply rules to the dataset I made. I wanted to know how to apply rules to the dataset?
Why my code is not working? How to correct the error?
i=0:2;
j=0:2;
k=0:2;
l=0:2;
m=0:2;
n=0:2;
A=fullfact([3 3 3 3 3 3])-1;
B = char(A+'0');
states=B;
rownames = states;
prefix = 'T';
varnames = strcat({prefix}, states);
selected=cell(729,729);
SelectedTable = cell2dataset (selected, 'VarNames', varnames, 'ObsNames', varnames);
I have been trying to apply rules to this attached SelectedTable dataset but got unsuccessful.
Np=2;
syms lam_p;
case1_src_i = 0:Np-1;
SelectedTable(varNames(case1_src_i), :, :, :, :, :), obsNames(case1_src_i+1), :, :, :, :, :) = lam_p;
* * *SelectedTable(varNames(case1_src_i), :, :, :, :, :), obsNames(case1_src_i+1), :, :, :, :, :) = lam_p;
Error: Unexpected MATLAB operator.***
How to rectify the error?
Please help
Regards
Surabhi
I have attached the code and the dataset.

답변 (1개)

Walter Roberson
Walter Roberson 2017년 11월 17일
Count the brackets. The number below each bracket will indicate the nesting depth after the bracket
SelectedTable(varNames(case1_src_i), :, :, :, :, :), obsNames(case1_src_i+1), :, :, :, :, :) = lam_p;
1 2 1 0 1 0 -1
  댓글 수: 9
Walter Roberson
Walter Roberson 2017년 11월 19일
You have gone back to the 2D representation. You should only have two subscripts.
surabhi sachdeva
surabhi sachdeva 2017년 11월 19일
Sir, By "subscript" I suppose you are talking about (i,j,k,l,m,n)
My data input is 6-variable. So, I have to take 6 subscripts in applying rules.
Earlier, I got the error of converting values to double which I have already done.
  • SelectedTable(VarNames(case1_src_i), :, :, :, :, :, ObsNames(case1_src_i+1), :, :, :, :, :) = lam_p;
Subscript indices must either be real positive integers or logicals.*
Still the same error but I am trying to resolve.
Please help

이 질문은 마감되었습니다.

제품

Community Treasure Hunt

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

Start Hunting!

Translated by