MATLAB POLYSPACE 7 Przewodnik Instalacji Strona 473

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
Przeglądanie stron 472
M-Lint Code Check Report
Messages and Resulting Changes for the lengthofline Example. The
following table describes each message and demonstrates a way to change the
file, based on the message.
Message — Code (Original Line Numbers)
Explanation and Updated Code (New
Line Numbers)
22: The value assigned here to
variable 'nothandle' might never be
used.
—————————————————
22 nothandle = ~ishandle(hline);
23 for nh = 1:prod(size(hline))
24 notline(nh) = ~ishandle(hline(nh))
...
In line 22, nothandle is assigned a valu e, bu t
nothandle is probably not used anywhere after
thatinthefile. Thelinemightbeextraneous
and you could delete it. But it might be that
you actually intended to u se the variable, which
isthecaseforthe
lengthofline example.
Update line 24 to use
nothandle,whichis
faster th a n computing
~ishandle for ea ch
iteration of the loop, as s h own he re.
22 nothandle = ~ishandle(hline);
23 for nh = 1:numel(hline)
24 notline(nh) = nothandle(nh) ...
23: NUMEL(x) is usually faster than
PROD(SIZE(x)).
—————————————————
23 for nh = 1:prod(size(hline))
While prod(size(x)) returns the number
of elements in a m atrix, the
numel function
wasdesignedtodojustthat,andthereforeis
usually more efficient. Type
doc numel to see
the
numel reference page. Change the line to
23 for nh = 1:numel(hline)
7-21
Przeglądanie stron 472
1 2 ... 468 469 470 471 472 473 474 475 476 477 478 ... 617 618

Komentarze do niniejszej Instrukcji

Brak uwag

LiquiFix Unknown user manuals

The list of LiquiFix Unknown products contains 2 user manuals for 2 models. All pdf user’s guides are available for download or viewing online.

Click on an alphabet below to scroll to the full list of models starting with that letter

Models Document Type
400104
Installation Guide   LiquiFix 400104 Installation Guide, 1 pages
400185
Instruction Manual   LiquiFix 400185 Instructions / Assembly, 1 pages