Writing a Minitab macro that can manipulate data in all columns

M

minit

Hello
Im trying to write a macro in minitab that can manipulate data in all coulmns.

an example of what Im trying do write is:

for i=1:10
plot(c1,c(i))
end

This would be a matlab code however.
how can I create a loop for columns in minitab.
Is there a better way then creating a loop.
Is there a better way then creating a macro.

Thx in advance
 
A

Allattar

The equivalent code in Minitab would be

do k1 = 1:10

plot c1 ck1

enddo

This would be for a global macro.

Whether a macro is better or not depends on the taks you are trying to run. In some cases the dialogue boxes can handle multiple options by defining groups in columns. Macros can be a useful tool though.

I cant really say which is best without understanding more about the problem.

Regards
 
M

minit

Thx
How should I declare the variable k1.
also minitab writes me an error saying that the variable c1 can not be recognized. Why ?
 
A

Allattar

It sounds like you are using a local macro.

Global macros start
GMACRO
NAME

<BODY of Macro>

ENDMACRO

Global macro work from columns and constants within the worksheet.

Local Macros start
MACRO
NAME <Variables to be read in>
MCOLUMN <Column variables>
MCONSTANT <Constant Variables>

<BODY of macro>

ENDMACRO

You would need to define a constant in a local macro by
MCONSTANT k1
and a column with
MCOLUMN C1

Actually constants and columns could be defined as anything, as long as they dont conflict with a command.
 
Top Bottom