필터 지우기
필터 지우기

i am getting this error" Undefined function 'mtimes' for input arguments of type 'struct'." for th

조회 수: 4 (최근 30일)
i have a structure file named swarm. i assigned another term called as poplc as follows poplc = swarm (b(k), 1 : V); for p = 1 : 30 step = .95; poplc(p) = (1+step/100)*poplc(p); end
what shall i do??i am not able to figure out??

답변 (1개)

dbmn
dbmn 2016년 10월 6일
It seems that your variable poplc is a struct. In order to mulitply its values you need to access the fields of the struct.
I try to explain it in a mini example.
a.value = 1;
b.xyz = 2;
Try to multiply a and b
c = a*b
You will get the error: "Undefined operator '*' for input arguments of type 'struct'."
But if you use
c = a.value * b.xyz
you should be fine.

카테고리

Help CenterFile Exchange에서 Optimization에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by