Matlab coder and exponentiation
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
David Short
am 27 Mär. 2015
Kommentiert: David Short
am 30 Mär. 2015
I'm sure there is a way to get matlab coder to do A = B ^ C where all A, B and C are scalers, but for the life of me, I'm just not seeing it.
Every way I try and express it ends up with the error "Matrix power is not supported for code generation."
A = B(1) .^ C(1) isn't getting me where I want to go.
I can do it in C. I can do it in Matlab, I just can't get Matlab to do it in C.
2 Kommentare
Konstantinos Sofos
am 27 Mär. 2015
A,B and C are matrices or scalars...i cannot understand the "scalers" that you wrote?
Akzeptierte Antwort
Ryan Livingston
am 28 Mär. 2015
This sounds like an installation issue. Can you check to see that the files:
fullfile(matlabroot,'toolbox','eml','lib','matlab','ops','mpower.m')
fullfile(matlabroot,'toolbox','eml','lib','matlab','ops','power.m')
exist in your MATLAB installation? Likely they do not as ^ should be supported for code generation.
If they are not present, reinstalling would be advised. Customer support should be able to help you get going again if the install doesn't seem to be successful.
If the files are present, try to run
restoredefaultpath
rehash toolboxcache
and see if codegen succeeds.
Weitere Antworten (1)
Siehe auch
Kategorien
Mehr zu MATLAB Coder finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!