필터 지우기
필터 지우기

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

조회 수: 1 (최근 30일)
Forrest
Forrest 2014년 5월 20일
답변: Forrest 2014년 5월 20일
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