Code Generation does not support scripts

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 comentario

Walter Roberson
Walter Roberson el 5 de Nov. de 2018
What would you like codegen to do differently for a script compared to wrapping into a function with the same name?

Iniciar sesión para comentar.

Respuestas (1)

shreya joshi
shreya joshi el 5 de Nov. de 2018

0 votos

Try function process %#codegen
it works if it is a function .

Etiquetas

Preguntada:

el 19 de Jul. de 2017

Comentada:

el 5 de Nov. de 2018

Community Treasure Hunt

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

Start Hunting!

Translated by