Code Generation does not support scripts
Show older comments
I was trying to use %#codegen on my script. It has an error saying that codegen does not support scripts for A=cell(10,1). Is there any other techniques i can use to revise the code?
%#codegen
A=cell(10,1);
A{1}=[ -1,-1,-1;
-1,-1,-1;
-1,-1,-1;
+1,+1,+1;
+1,+1,+1;
+1,+1,+1];
A{2}=[ -1,-1,-1,-1,-1,-1;
-1,-1,-1,-1,-1,-1;
-1,-1,-1,-1,-1,-1;
+1,+1,+1,+1,+1,+1;
+1,+1,+1,+1,+1,+1;
+1,+1,+1,+1,+1,+1];
A{3}= [ -1,-1,-1,-1,-1,-1,-1,-1,-1;
-1,-1,-1,-1,-1,-1,-1,-1,-1;
-1,-1,-1,-1,-1,-1,-1,-1,-1;
+1,+1,+1,+1,+1,+1,+1,+1,+1;
+1,+1,+1,+1,+1,+1,+1,+1,+1;
+1,+1,+1,+1,+1,+1,+1,+1,+1];
A{4}=[ -1,-1,+1,+1;
-1,-1,+1,+1;
-1,-1,+1,+1;
-1,-1,+1,+1;
-1,-1,+1,+1;
-1,-1,+1,+1;
-1,-1,+1,+1;
-1,-1,+1,+1];
A{5}=[ -1,-1,-1,+1,+1,+1;
-1,-1,-1,+1,+1,+1;
-1,-1,-1,+1,+1,+1;
-1,-1,-1,+1,+1,+1;
-1,-1,-1,+1,+1,+1;
-1,-1,-1,+1,+1,+1;
-1,-1,-1,+1,+1,+1;
-1,-1,-1,+1,+1,+1];
A{6}=[ -1,-1,-1,-1;
-1,-1,-1,-1;
-1,-1,-1,-1;
-1,-1,-1,-1;
+1,+1,+1,+1;
+1,+1,+1,+1;
+1,+1,+1,+1;
+1,+1,+1,+1];
A{7}=[ +1,-1,-1,+1;
+1,-1,-1,+1;
+1,-1,-1,+1;
+1,-1,-1,+1;
+1,-1,-1,+1;
+1,-1,-1,+1;
+1,-1,-1,+1;
+1,-1,-1,+1];
A{8}=[ +1,+1,-1,-1,+1,+1;
+1,+1,-1,-1,+1,+1;
+1,+1,-1,-1,+1,+1;
+1,+1,-1,-1,+1,+1;
+1,+1,-1,-1,+1,+1;
+1,+1,-1,-1,+1,+1;
+1,+1,-1,-1,+1,+1;
+1,+1,-1,-1,+1,+1];
A{9}=[ +1,+1,-1,-1,-1,+1,+1;
+1,+1,-1,-1,-1,+1,+1;
+1,+1,-1,-1,-1,+1,+1;
+1,+1,-1,-1,-1,+1,+1;
+1,+1,-1,-1,-1,+1,+1;
+1,+1,-1,-1,-1,+1,+1;
+1,+1,-1,-1,-1,+1,+1;
+1,+1,-1,-1,-1,+1,+1];
A{10}=[ +1,+1,+1,-1,-1,-1,+1,+1,+1;
+1,+1,+1,-1,-1,-1,+1,+1,+1;
+1,+1,+1,-1,-1,-1,+1,+1,+1;
+1,+1,+1,-1,-1,-1,+1,+1,+1;
+1,+1,+1,-1,-1,-1,+1,+1,+1;
+1,+1,+1,-1,-1,-1,+1,+1,+1;
+1,+1,+1,-1,-1,-1,+1,+1,+1;
+1,+1,+1,-1,-1,-1,+1,+1,+1];
1 Comment
Walter Roberson
on 5 Nov 2018
What would you like codegen to do differently for a script compared to wrapping into a function with the same name?
Answers (1)
shreya joshi
on 5 Nov 2018
0 votes
Try function process %#codegen
it works if it is a function .
Categories
Find more on Function Definition in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!