Hi, what does ; exactly mean?

7 vues (au cours des 30 derniers jours)
Elfrida Jacobsen
Elfrida Jacobsen le 29 Nov 2021
Commenté : Stephen23 le 29 Nov 2021
I know that .* mean that you multiple the two elements of equally sized arrays. But in the first array and second the ; symbol occurs, but what is the exact meaning of this symbol? here is function
x=[1 2;3 4;5 6; 7 8].*[1;2;3;4]
  1 commentaire
Stephen23
Stephen23 le 29 Nov 2021
Many basic MATLAB concepts, such as how to create matrices, are explained in the introductory tutorials:

Connectez-vous pour commenter.

Réponses (2)

Jan
Jan le 29 Nov 2021
Please read the Getting Started chapters of the documentation. This is recommended for beginners also: https://www.mathworks.com/learn/tutorials/matlab-onramp.html . Learning the basics from the manuals is more efficient than asking them in the forum.
The semicolon inside the concatenation operator [ ] or inside { } means a horizontal concatenation. Try it:
a = [1, 2]
a = 1×2
1 2
size(a)
ans = 1×2
1 2
b = [1; 2]
b = 2×1
1 2
size(b)
ans = 1×2
2 1

Alan Stevens
Alan Stevens le 29 Nov 2021
It means start a new row, e.g.
x = [1 2; 3 4];
disp(x)
1 2 3 4

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by