MATLAB-Befehle: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
Keine Bearbeitungszusammenfassung |
|||
| (27 dazwischenliegende Versionen von 2 Benutzern werden nicht angezeigt) | |||
| Zeile 1: | Zeile 1: | ||
[[Kategorie:MATLAB]] | [[Kategorie:MATLAB]] | ||
[[Datei:MATLAB-Symbol-700x394.jpg|thumb|rigth|450px|Abb. 1: MATrix LABoratory ( | [[Datei:MATLAB-Symbol-700x394.jpg|thumb|rigth|450px|Abb. 1: MATrix LABoratory (MATLAB<sup>®</sup>)]] | ||
'''Autor:''' [[Benutzer:Ulrich_Schneider| Prof. Dr.-Ing. Schneider]] | '''Autor:''' [[Benutzer:Ulrich_Schneider| Prof. Dr.-Ing. Schneider]] | ||
<br>Diese Seite gibt eine Übersicht gebräuchlicher | <br>Diese Seite gibt eine Übersicht gebräuchlicher MATLAB<sup>®</sup>-Befehle. Die volle Übersicht finden Sie auf der [https://www.mathworks.com/help/referencelist.html MathWorks-Seite]. | ||
<!-- | <!-- | ||
== Variablen == | == Variablen == | ||
| Zeile 12: | Zeile 12: | ||
|- | |- | ||
| [https://www.mathworks.com/help/matlab/ref/abs.html abs] || Absolutbetrag berechnen | | [https://www.mathworks.com/help/matlab/ref/abs.html abs] || Absolutbetrag berechnen | ||
|- | |||
| [https://www.mathworks.com/help/matlab/ref/angle.html angle] || Winkel einer komplexen Zahl im Bogenmaß berechnen | |||
|- | |||
| [https://www.mathworks.com/help/matlab/ref/ceil.html ceil] || rundet immer auf zur nächsten größeren ganzen Zahl | |||
|- | |||
| [https://www.mathworks.com/help/matlab/ref/complex.html complex] || Komplexe Zahl erstellen | |||
|- | |||
| [https://www.mathworks.com/help/matlab/ref/conj.html conj] || komplex-konjugierte Zahl berechnen | |||
|- | |||
| [https://www.mathworks.com/help/matlab/ref/det.html det] || Determinante einer Matrix | |||
|- | |||
| [https://www.mathworks.com/help/matlab/ref/eig.html eig] || Eigenwerte und Eigenvektor | |||
|- | |- | ||
| [https://www.mathworks.com/help/matlab/ref/exp.html exp] || <math>e^x</math> berechnen | | [https://www.mathworks.com/help/matlab/ref/exp.html exp] || <math>e^x</math> berechnen | ||
|- | |||
| [https://www.mathworks.com/help/matlab/ref/floor.html floor] || rundet immer ab zur nächsten kleineren ganzen Zahl | |||
|- | |||
| [https://www.mathworks.com/help/matlab/ref/imag.html imag] || gibt Imaginärteil einer komplexen Zahl aus | |||
|- | |- | ||
| [https://www.mathworks.com/help/matlab/ref/log.html log] || log zur Basis e berechnen | | [https://www.mathworks.com/help/matlab/ref/log.html log] || log zur Basis e berechnen | ||
|- | |- | ||
| [https://www.mathworks.com/help/matlab/ref/log10.html log10] || log zur Basis 10 berechnen | | [https://www.mathworks.com/help/matlab/ref/log10.html log10] || Modulus nach Interger-Division | ||
|- | |||
| [https://www.mathworks.com/help/matlab/ref/mod.html mod] || log zur Basis 10 berechnen | |||
|- | |||
| [https://www.mathworks.com/help/matlab/ref/norm.html norm] || Matrix- oder Vektornorm | |||
|- | |||
| [https://www.mathworks.com/help/matlab/ref/round.html round] || Runden | |||
|- | |- | ||
| [https://www.mathworks.com/help/matlab/ref/sign.html sign] || Vorzeichen berechnen | | [https://www.mathworks.com/help/matlab/ref/sign.html sign] || Vorzeichen berechnen | ||
|- | |- | ||
| [https://www.mathworks.com/help/matlab/ref/sqrt.html sqrt] || Quadratwurzel berechnen | | [https://www.mathworks.com/help/matlab/ref/sqrt.html sqrt] || Quadratwurzel berechnen | ||
|- | |||
| [https://www.mathworks.com/help/matlab/ref/sum.html sum] || Summe der Array-Elemente | |||
|- | |- | ||
| [https://www.mathworks.com/help/matlab/ref/round.html round] || rundet ab/auf zur nächst kleineren/größeren ganzen Zahl | | [https://www.mathworks.com/help/matlab/ref/round.html round] || rundet ab/auf zur nächst kleineren/größeren ganzen Zahl | ||
|- | |- | ||
| [https://www.mathworks.com/help/matlab/ref/ | | [https://www.mathworks.com/help/matlab/ref/real.html real] || gibt Realteil einer komplexen Zahl aus | ||
|- | |||
| [https://www.mathworks.com/help/matlab/ref/trace.html trace] || Summe der Diagonalelemente einer Matrix (Spur) | |||
|- | |||
|} | |||
== Trigonometrische Funktionen == | |||
{| class="wikitable" | |||
|- | |||
! Befehl !! Beschreibung | |||
|- | |||
| [https://www.mathworks.com/help/matlab/ref/acos.html acos] || Arcus-Kosinus | |||
|- | |||
| [https://www.mathworks.com/help/matlab/ref/asin.html asin] || Arcus-Sinus | |||
|- | |||
| [https://www.mathworks.com/help/matlab/ref/atan.html atan] || Arcus-Tangens | |||
|- | |||
| [https://www.mathworks.com/help/matlab/ref/cos.html cos] || Kosinus | |||
|- | |||
| [https://www.mathworks.com/help/matlab/ref/cosh.html cosh] || Kosinus-Hyperbolikus | |||
|- | |||
| [https://www.mathworks.com/help/matlab/ref/cot.html cot] || Kotangens | |||
|- | |||
| [https://www.mathworks.com/help/matlab/ref/sin.html sin] || Sinus (Winkel im Bogenmaß) | |||
|- | |||
| [https://www.mathworks.com/help/matlab/ref/sind.html sind] || Sinus (Winkel im °) | |||
|- | |||
| [https://www.mathworks.com/help/matlab/ref/sind.html sinh] || Sinus-Hyperbolicus | |||
|- | |||
| [https://www.mathworks.com/help/matlab/ref/tan.html tan] || Tangens | |||
|} | |||
== Array-Informationen == | |||
{| class="wikitable" | |||
|- | |||
! Befehl !! Beschreibung | |||
|- | |||
| [https://www.mathworks.com/help/matlab/ref/length.html length] || Länge eines Vektors | |||
|- | |||
| [https://www.mathworks.com/help/matlab/ref/size.html size] || Zahl der Zeilen und Spalten eines Arrays | |||
|} | |||
== Array-Operationen== | |||
{| class="wikitable" | |||
|- | |||
! Befehl !! Beschreibung | |||
|- | |||
| ' || Transposition | |||
|- | |||
| .* || elementweise Array-Multiplikation | |||
|- | |||
| ./ || elementweise Array-Division | |||
|- | |||
| .^|| elementweisePotenzieren | |||
|- | |||
| :|| Operation zum erzeugen einer Laufvariable und Vektoren | |||
|- | |||
| [https://www.mathworks.com/help/matlab/ref/inv.html inv] || inverse Matrix | |||
|- | |||
| [https://www.mathworks.com/help/matlab/ref/dot.html dot] || Skalarprodukt | |||
|- | |||
| [https://www.mathworks.com/help/matlab/ref/cross.html cross] || Vektorprodukt | |||
|- | |||
| [https://www.mathworks.com/help/matlab/ref/linspace.html linspace] || zum Erzeugen von Vektoren; Intervallaufteilung | |||
|- | |||
| [https://www.mathworks.com/help/matlab/ref/eye.html eye] || Einheitsmatrix | |||
|- | |||
| [https://www.mathworks.com/help/matlab/ref/diag.html diag] || Diagonalmatrix | |||
|- | |- | ||
| [https://www.mathworks.com/help/matlab/ref/ | | [https://www.mathworks.com/help/matlab/ref/zeros.html zeros] || Array aus lauter Nullen | ||
|- | |- | ||
| [https://www.mathworks.com/help/matlab/ref/ | | [https://www.mathworks.com/help/matlab/ref/ones.html ones] || Array aus lauter Einsen | ||
|- | |- | ||
| [https://www.mathworks.com/help/matlab/ref/ | | [https://www.mathworks.com/help/matlab/ref/rand.html rand] || gleichförmig verteilte Zufallszahlen | ||
|- | |- | ||
| [https://www.mathworks.com/help/matlab/ref/ | | [https://www.mathworks.com/help/matlab/ref/randn.html randn] || normalverteilte Zufallszahlen | ||
|- | |- | ||
| [https://www.mathworks.com/help/matlab/ref/ | | [https://www.mathworks.com/help/matlab/ref/cell.html cell] || Cell-Array | ||
|- | |- | ||
| [https://www.mathworks.com/help/matlab/ref/ | | [https://www.mathworks.com/help/matlab/ref/cell2mat.html cell2mat] || wandelt Cell-Array in ein normales Array um | ||
|- | |- | ||
| [https://www.mathworks.com/help/matlab/ref/num2cell.html num2cell] || wandelt normales Array in Cell-Array um | |||
|} | |} | ||
<!-- | <!-- | ||
| Zeile 66: | Zeile 157: | ||
|} | |} | ||
--> | --> | ||
== Grafik == | == Grafik == | ||
{| class="wikitable" | {| class="wikitable" | ||
| Zeile 73: | Zeile 165: | ||
| [https://www.mathworks.com/help/matlab/ref/figure.html figure] || neue Figur erstellen | | [https://www.mathworks.com/help/matlab/ref/figure.html figure] || neue Figur erstellen | ||
|- | |- | ||
| [https://www.mathworks.com/help/matlab/ref/plot.html plot] || Messwerte anzeigen | | [https://www.mathworks.com/help/matlab/ref/plot.html plot],[https://www.mathworks.com/help/matlab/ref/fplot.html fplot] || Messwerte anzeigen | ||
|- | |- | ||
| [https://www.mathworks.com/help/matlab/ref/xlabel.html xlabel] || X-Achse beschriften | | [https://www.mathworks.com/help/matlab/ref/xlabel.html xlabel] || X-Achse beschriften | ||
| Zeile 91: | Zeile 183: | ||
| [https://www.mathworks.com/help/matlab/ref/xlim.html xlim] <br> [https://de.mathworks.com/help/matlab/ref/ylim.html ylim] <br> [https://de.mathworks.com/help/matlab/ref/axis.html?searchHighlight=axis&s_tid=srchtitle_axis_1 axis] || Anzeigebeereich einschränken | | [https://www.mathworks.com/help/matlab/ref/xlim.html xlim] <br> [https://de.mathworks.com/help/matlab/ref/ylim.html ylim] <br> [https://de.mathworks.com/help/matlab/ref/axis.html?searchHighlight=axis&s_tid=srchtitle_axis_1 axis] || Anzeigebeereich einschränken | ||
|- | |- | ||
| [https://www.mathworks.com/help/matlab/ref/ | | [https://www.mathworks.com/help/matlab/ref/contour.html contour], [https://www.mathworks.com/help/matlab/ref/fcontour.html fcontour] || 3-dimensionale Darstellung (Höhenlinien) | ||
|- | |||
| [https://www.mathworks.com/help/matlab/ref/fimplicit3.html fimplicit3] || 3-dimensionale Darstellung über einen festen Wertebereich | |||
|- | |- | ||
| [https://www.mathworks.com/help/matlab/ref/surf.html surf] || 3-dimensionale Darstellung der Matrix z als farbige Oberfläche | | [https://www.mathworks.com/help/matlab/ref/mesh.html mesh], [https://www.mathworks.com/help/matlab/ref/fmesh.html fmesh] || 3-dimensionale Darstellung der Matrix z als Maschendrahtmodell | ||
|- | |||
| [https://www.mathworks.com/help/matlab/ref/surf.html surf], [https://www.mathworks.com/help/matlab/ref/fsurf.html fsurf] || 3-dimensionale Darstellung der Matrix z als farbige Oberfläche | |||
|- | |- | ||
| [https://www.mathworks.com/help/matlab/ref/hist.html hist] || Histogramm der Häufigkeit des Auftretetens von Werten | | [https://www.mathworks.com/help/matlab/ref/hist.html hist] || Histogramm der Häufigkeit des Auftretetens von Werten | ||
| Zeile 138: | Zeile 234: | ||
| [https://de.mathworks.com/help/images/ref/im2bw.html?s_tid=doc_ta im2bw] <br> [https://de.mathworks.com/help/images/ref/imbinarize.html imbinarize]|| Binärbild erzeugen | | [https://de.mathworks.com/help/images/ref/im2bw.html?s_tid=doc_ta im2bw] <br> [https://de.mathworks.com/help/images/ref/imbinarize.html imbinarize]|| Binärbild erzeugen | ||
|- | |- | ||
| [https://de.mathworks.com/help/matlab/ref/im2gray.html?s_tid=doc_ta im2gray] <br> [https://de.mathworks.com/help/matlab/ref/rgb2gray.html?s_tid=doc_ta rgb2gray] || Grauwertbild erzeugen | | [https://de.mathworks.com/help/matlab/ref/im2gray.html?s_tid=doc_ta im2gray] <br> [https://de.mathworks.com/help/matlab/ref/rgb2gray.html?s_tid=doc_ta rgb2gray] <br> [https://de.mathworks.com/help/images/ref/im2uint8.html im2uint8] || Grauwertbild erzeugen | ||
|- | |- | ||
| [https://de.mathworks.com/help/images/ref/imcomplement.html?s_tid=doc_ta imcomplement] || Komplementärbild erzeugen | | [https://de.mathworks.com/help/images/ref/imcomplement.html?s_tid=doc_ta imcomplement] || Komplementärbild erzeugen | ||
| Zeile 297: | Zeile 393: | ||
| [https://de.mathworks.com/help/matlab/ref/fgetl.html?s_tid=doc_ta fgetl] || Zeile aus Datei auslesen | | [https://de.mathworks.com/help/matlab/ref/fgetl.html?s_tid=doc_ta fgetl] || Zeile aus Datei auslesen | ||
|- | |- | ||
|} | |||
== Sonstige == | |||
{| class="wikitable" | |||
|- | |||
! Befehl !! Beschreibung | |||
|- | |||
| [https://www.mathworks.com/help/matlab/ref/clc.html clc] || löscht alle Ausgaben im Command Window | |||
|- | |||
| [https://www.mathworks.com/help/matlab/ref/clear.html clear] || löscht Variable | |||
|- | |||
| [https://www.mathworks.com/help/matlab/ref/close.html close] || schließt geöffneten Grafikfenster (figure) | |||
|- | |||
| [https://www.mathworks.com/help/matlab/ref/doc.html doc] || öffnet die Dokumentation der spezifischen Funktion | |||
|- | |||
| [https://www.mathworks.com/help/matlab/ref/edit.html edit] || öffnet den Editor | |||
|- | |||
| [https://www.mathworks.com/help/matlab/ref/whos.html whos] || gibt im Command Window Informationen zu Größe und Datentyp wieder | |||
|- | |||
| [https://www.mathworks.com/help/matlab/ref/simulink.html simulink] || öffnet Simulink | |||
|} | |} | ||
| Zeile 302: | Zeile 417: | ||
* [https://www.studocu.com/de/document/universitat-duisburg-essen/informatik/matlab-befehle-zusammenfassung-informatik/2959996 MATLAB<sup>®</sup> Befehle - Zusammenfassung Informatik] | * [https://www.studocu.com/de/document/universitat-duisburg-essen/informatik/matlab-befehle-zusammenfassung-informatik/2959996 MATLAB<sup>®</sup> Befehle - Zusammenfassung Informatik] | ||
* [https://www.mathworks.com/content/dam/mathworks/fact-sheet/matlab-basic-functions-reference.pdf MATLAB<sup>®</sup> Basic Functions Reference] | * [https://www.mathworks.com/content/dam/mathworks/fact-sheet/matlab-basic-functions-reference.pdf MATLAB<sup>®</sup> Basic Functions Reference] | ||
---- | |||
[[MATLAB_Repetitorium|MATLAB<sup>®</sup> Repetitorium]] | |||
Aktuelle Version vom 12. Juni 2025, 11:03 Uhr

Autor: Prof. Dr.-Ing. Schneider
Diese Seite gibt eine Übersicht gebräuchlicher MATLAB®-Befehle. Die volle Übersicht finden Sie auf der MathWorks-Seite.
Mathematische Funktionen
| Befehl | Beschreibung |
|---|---|
| abs | Absolutbetrag berechnen |
| angle | Winkel einer komplexen Zahl im Bogenmaß berechnen |
| ceil | rundet immer auf zur nächsten größeren ganzen Zahl |
| complex | Komplexe Zahl erstellen |
| conj | komplex-konjugierte Zahl berechnen |
| det | Determinante einer Matrix |
| eig | Eigenwerte und Eigenvektor |
| exp | berechnen |
| floor | rundet immer ab zur nächsten kleineren ganzen Zahl |
| imag | gibt Imaginärteil einer komplexen Zahl aus |
| log | log zur Basis e berechnen |
| log10 | Modulus nach Interger-Division |
| mod | log zur Basis 10 berechnen |
| norm | Matrix- oder Vektornorm |
| round | Runden |
| sign | Vorzeichen berechnen |
| sqrt | Quadratwurzel berechnen |
| sum | Summe der Array-Elemente |
| round | rundet ab/auf zur nächst kleineren/größeren ganzen Zahl |
| real | gibt Realteil einer komplexen Zahl aus |
| trace | Summe der Diagonalelemente einer Matrix (Spur) |
Trigonometrische Funktionen
| Befehl | Beschreibung |
|---|---|
| acos | Arcus-Kosinus |
| asin | Arcus-Sinus |
| atan | Arcus-Tangens |
| cos | Kosinus |
| cosh | Kosinus-Hyperbolikus |
| cot | Kotangens |
| sin | Sinus (Winkel im Bogenmaß) |
| sind | Sinus (Winkel im °) |
| sinh | Sinus-Hyperbolicus |
| tan | Tangens |
Array-Informationen
| Befehl | Beschreibung |
|---|---|
| length | Länge eines Vektors |
| size | Zahl der Zeilen und Spalten eines Arrays |
Array-Operationen
| Befehl | Beschreibung |
|---|---|
| ' | Transposition |
| .* | elementweise Array-Multiplikation |
| ./ | elementweise Array-Division |
| .^ | elementweisePotenzieren |
| : | Operation zum erzeugen einer Laufvariable und Vektoren |
| inv | inverse Matrix |
| dot | Skalarprodukt |
| cross | Vektorprodukt |
| linspace | zum Erzeugen von Vektoren; Intervallaufteilung |
| eye | Einheitsmatrix |
| diag | Diagonalmatrix |
| zeros | Array aus lauter Nullen |
| ones | Array aus lauter Einsen |
| rand | gleichförmig verteilte Zufallszahlen |
| randn | normalverteilte Zufallszahlen |
| cell | Cell-Array |
| cell2mat | wandelt Cell-Array in ein normales Array um |
| num2cell | wandelt normales Array in Cell-Array um |
Grafik
| Befehl | Beschreibung |
|---|---|
| figure | neue Figur erstellen |
| plot,fplot | Messwerte anzeigen |
| xlabel | X-Achse beschriften |
| title | Figuren-Titel ändern |
| sgtitle | Figuren-Titel über alle Subplots |
| hold | Daten im Plot halten |
| text | Textfeld erzeugen |
| legend | Legende hinzufügen |
| xline | Horizontale Linie zeichnen |
| xlim ylim axis |
Anzeigebeereich einschränken |
| contour, fcontour | 3-dimensionale Darstellung (Höhenlinien) |
| fimplicit3 | 3-dimensionale Darstellung über einen festen Wertebereich |
| mesh, fmesh | 3-dimensionale Darstellung der Matrix z als Maschendrahtmodell |
| surf, fsurf | 3-dimensionale Darstellung der Matrix z als farbige Oberfläche |
| hist | Histogramm der Häufigkeit des Auftretetens von Werten |
| histogram | Histogramm der Häufigkeit des Auftretetens von Werten |
| close | Grafikfenster schließen |
| clf | Inhalt des Grafikfensters löschen |
| stairs | Daten werden als Stufen dargestellt |
| stem | Daten werden als diskrete Linien dargestellt |
| bar | Balkendiagramm |
| quiver | Vektorpfeil in Plot einzeichnen |
Bildverarbeitung - Grafik
| Befehl | Beschreibung |
|---|---|
| colormap | Farbskala anzeigen und verändern |
| ginput | Koordinaten aus einem Graphen auslesen |
| imread | Bilddatei einlesen |
| imwrite | Bilddatei auf Festplatte schreiben |
| image | Bild aus einem Array darstellen |
| imshow | Bild darstellen |
| imagesc | Bild mit skalierten Farben darstellen |
| imshowpair | 2 Bilder vergleichen |
| graythresh | Automatische Schwellwertbestimmung |
| im2bw imbinarize |
Binärbild erzeugen |
| im2gray rgb2gray im2uint8 |
Grauwertbild erzeugen |
| imcomplement | Komplementärbild erzeugen |
| cat | Verkettung von Arrays |
Bildverarbeitung - Bildtransformationen
| Befehl | Beschreibung |
|---|---|
| fft2 | 2-D Fast Fourier Transform |
| ifft2 | Inverse Fast Fourier Transform |
| fftshift | Die niedrigen Frequenzen werden ins Zentrum des Spektrums verschoben |
| ifftshift | Inverse Shift Operation |
| conv2 | 2-D Konvolution |
| deconvwnr | Heuristisches Wiener Filter |
| medfilt2 | Median Filter |
| hough | Hough Transformation |
| houghpeaks | Akkumulatoren der Hough Transformation |
| houghlines | Liniensegmente mittels Hough Transformation |
| fspecial | 2D-Filterkern/Point-Spread-Function erzeugen |
| imfilter | Filterung/Anwendung einer Point-Spread-Function |
Bildverarbeitung - Objektanalyse
| Befehl | Beschreibung |
|---|---|
| edge | Kantenerkennung |
| imfindcircles | Hough Transformation für Kreise |
| viscircles | Kreise zeichnen |
| bwboundaries | Ränder in Binärbildern erkennen |
| bwtraceboundary | Ränder in Binärbildern verfolgen |
| visboundaries | Regionsrenzen darstellen |
| regionprops | Eigenschaften von Regionen abfragen |
Morphologische Operationen
| Befehl | Beschreibung |
|---|---|
| imerode | erodieren |
| imdilate | dilatieren |
| strel | Strukturelement erstellen |
| imopen | öffnen |
| imclose | schließen |
| bwskel | skeletieren |
| bwperim | Umrandung |
| bwhitmiss | Hit or Miss Operation |
| imtophat | Top-Hat Transformation |
| imbothat | Bottom-Hat Transformation |
| imclearborder | Strukturen am Rand unterdrücken |
| imfill | Regionen und Löcher füllen |
| bwmorph | Morphologische Operationen auf Binärbilder ausführen |
Statistik
| Befehl | Beschreibung |
|---|---|
| min | Minimum |
| max | Maximum |
| mean | Durchschnitt |
| median | Median |
| std | Standardabweichung |
| var | Varianz |
Regression
| Befehl | Beschreibung |
|---|---|
| polyfit | Polynomische Regression |
| polyval | Polynom berechnen |
Zeitmessung
| Befehl | Beschreibung |
|---|---|
| tic | Stopuhr starten |
| toc | Stopuhr auslesen |
Dateiverarbeitung
| Befehl | Beschreibung |
|---|---|
| addpath | Dateipfad zum Suchpfad hinzufügen |
| rmpath | Dateipfad aus Suchpfad entfernen |
| uigetdir | Ordner über Dialog-Box einlesen |
| uigetfile | Dateiname/-pfad über Dialog-Box einlesen |
| load | Variablen aus Datei in Workspace laden |
| save | Variablen aus Workspace in Datei speichern |
| fopen | Datei öffnen |
| fclose | Datei schließen |
| feof | Test auf Dateiende |
| fgetl | Zeile aus Datei auslesen |
Sonstige
| Befehl | Beschreibung |
|---|---|
| clc | löscht alle Ausgaben im Command Window |
| clear | löscht Variable |
| close | schließt geöffneten Grafikfenster (figure) |
| doc | öffnet die Dokumentation der spezifischen Funktion |
| edit | öffnet den Editor |
| whos | gibt im Command Window Informationen zu Größe und Datentyp wieder |
| simulink | öffnet Simulink |