Quelltext einbinden: Unterschied zwischen den Versionen

Aus HSHL Mechatronik
Zur Navigation springen Zur Suche springen
Keine Bearbeitungszusammenfassung
Keine Bearbeitungszusammenfassung
Zeile 10: Zeile 10:


== Beispiele ==
== Beispiele ==
 
=== <nowiki> <code>-Umgebung </nowiki>  ===
<code>
<code>
for i=1:10  
for i=1:10  
Zeile 29: Zeile 29:
</code>
</code>


=== %% <source>-Umbebung %% m===
=== <nowiki> <source>-Umbebung </nowiki> ===
<source line lang="matlab">
<source line lang="matlab">
for i=1:10  
for i=1:10  
Zeile 48: Zeile 48:
</source>
</source>


=== <nowiki> <syntaxhighlight> </nowiki> ===
<syntaxhighlight lang="matlab">
<syntaxhighlight lang="matlab">
<for i=1:10  
<for i=1:10  

Version vom 10. Mai 2014, 11:13 Uhr


Um Quelltext einzubinden benutzt man folgenden Syntax:

<code> ... </code>

Um Text von der Wiki-Markup auszuschließen benutzt man folgenden Syntax:

<nowiki> ... </nowiki>

Beispiele

<code>-Umgebung

for i=1:10 % try % image = CAMERA_DumpFrame(s); % catch err % error('MATLAB:RWTHMindstormsNXT:Sensor:unknown', 'An unknown Error occured while fetching the image. Please check that the Camera is connected and try again'); % end

   image = CAMERA_GetImage(com);
   handle = imshow(image);
   %pause(0.1)
   currTime(i) = toc(startTime);
   disp(['Aktuelle Zeit: ',num2str(currTime(i))])
   %imwrite(image,sprintf('NXTCamImage%03d.png',i));
   %imwrite(img,fullfile(workingDir,sprintf('HexBug%03d.png',n)));
   % ca. alle 4.8 Sekunden ein Bild

end;

<source>-Umbebung

for i=1:10 
%     try
%         image = CAMERA_DumpFrame(s);       
%     catch err
%         error('MATLAB:RWTHMindstormsNXT:Sensor:unknown', 'An unknown Error occured while fetching the image. Please check that the Camera is connected and try again');
%     end
    image = CAMERA_GetImage(com);
    handle = imshow(image);
    %pause(0.1)
    currTime(i) = toc(startTime);
    disp(['Aktuelle Zeit: ',num2str(currTime(i))])
    %imwrite(image,sprintf('NXTCamImage%03d.png',i));
    %imwrite(img,fullfile(workingDir,sprintf('HexBug%03d.png',n)));
    % ca. alle 4.8 Sekunden ein Bild
end;

<syntaxhighlight>

<for i=1:10 
%     try
%         image = CAMERA_DumpFrame(s);       
%     catch err
%         error('MATLAB:RWTHMindstormsNXT:Sensor:unknown', 'An unknown Error occured while fetching the image. Please check that the Camera is connected and try again');
%     end
    image = CAMERA_GetImage(com);
    handle = imshow(image);
    %pause(0.1)
    currTime(i) = toc(startTime);
    disp(['Aktuelle Zeit: ',num2str(currTime(i))])
    %imwrite(image,sprintf('NXTCamImage%03d.png',i));
    %imwrite(img,fullfile(workingDir,sprintf('HexBug%03d.png',n)));
    % ca. alle 4.8 Sekunden ein Bild
end;>

Weiterführende links