Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to do group commenting without commenting each line in Matlab?

Tags:

matlab

How can I comment a group of lines without commenting each line?

ie like 'c'

/*
printf("hello");
printf("there");
*/

in Matlab the only way I know to do this is to comment each line

%disp('hello')
%disp('there')

I have a 100 lines to comment out, I would prefer to group comment it like 'c'.

thx

like image 666
jdl Avatar asked Apr 12 '13 20:04

jdl


2 Answers

Can I comment a block of lines in an MATLAB file using /* ... */ as I can in C?:

%{
...
Block of COMMENTS HERE
...
...
%}
%CODE GOES HERE
plot(1:10)
like image 135
Franck Dernoncourt Avatar answered Oct 19 '22 03:10

Franck Dernoncourt


1) MATLAB v7+:

%{
...code to be commented
%}

2) Use the editor:

select all the lines, then choose toggle comment or something in the menu. it's there

like image 23
im so confused Avatar answered Oct 19 '22 04:10

im so confused