How to format a complex "IF-AND" statement for easy modification?

1 次查看(过去 30 天)
So I have a pretty simple question. I have a detailed IF-AND statement, that has a lot of various statements associated with it.
What I do in C# when I have something like this is to simply comment out the lines I don't want to use, and it just ignores that line. But it seems like Matlab doesn't like that.
Basically, I will want to toggle on/off various segments, without having to delete, or move things around. It would be nice if I could just comment out the lines I'd liek to have active.
I'll attach a picture as the format of the code below looks a bit hard to read: http://i.imgur.com/AtPzyHG.jpg
if true
%%Comparison Block LOW Data
% zCount = 1;
% for zI = 1:size(gStudy1.sDate)
% if( gStudy1.LcrT(zI) <= LcrT_tgt_U && gStudy1.LcrT(zI) >= LcrT_tgt_B... %Current LOW Price Delta
% && gStudy1.LcrD(zI) <= LcrD_tgt_U && gStudy1.LcrD(zI) >= LcrD_tgt_B... %Current LOW Time Delta
% && gStudy1.LprT(zI) <= LprT_tgt_U && gStudy1.LprT(zI) >= LprT_tgt_B... %Prior LOW Price Delta
% && gStudy1.LprD(zI) <= LprD_tgt_U && gStudy1.LprD(zI) >= LprD_tgt_B... %Prior LOW Calendar Time Delta
% && gStudy1.LprDTT(zI) <= LprDTT_tgt_U && gStudy1.LprDTT(zI) >= LprDTT_tgt_B... %Prior LOW Trade Time Delta
% )
% compDataSet(zCount,:) = gStudy1(zI,:);
%
% zCount = zCount+1;
% end
% end
end

采纳的回答

Forrest
Forrest 2014-5-20
Ah... I found it.
Adding the '...' at the front of the line seems to do the trick for what I need right now.
It looks like this, relative to my first attached picture: http://i.imgur.com/7GiloYD.jpg

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Calendar 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by