use of comma & semi colon

4 ビュー (過去 30 日間)
mrituanjay kumar
mrituanjay kumar 2020 年 3 月 5 日
コメント済み: Guillaume 2020 年 3 月 18 日
Please explain the meaning of below command in matlab
A(1, 1:9) = [ 30, 25, 16, 32, 15, 37, 18, 3, 10,]

採用された回答

Guillaume
Guillaume 2020 年 3 月 5 日
You're asking a very basic question. 5 minutes with any tutorial would have answered it. We recommend that you go through the free matlab onramp to learn the basics of matlab.
  4 件のコメント
mrituanjay kumar
mrituanjay kumar 2020 年 3 月 18 日
could you help me to solve a bar graph problem ?
I've two different arrays
a = [2 4 6 8 10]
b = [1 3 5 7 9]
now I want to plot these two array on a single bar graph where x axis values ranges from 1 to 4(1 2 3 4) and y axis contain two different bar graph side by side in different colour, it means at x axis value 1 I need two bar of values 2 & 1 similarly on at x axis value 2 I need two bar of values 4 & 3, similarly at x axis value 3 I need two bar of values 8 & 7, similarly at x axis value 4 I need two bar of values 10 & 9.
Guillaume
Guillaume 2020 年 3 月 18 日
Again, this is very basic and the documentation of bar has plenty of examples:
bar([a; b].'); %vertically concatenate the two vector and transpose so they're in columns

サインインしてコメントする。

その他の回答 (1 件)

KSSV
KSSV 2020 年 3 月 5 日
That means....in the matrix A in the first row (1) the columns one to 9 are filled with [ 30, 25, 16, 32, 15, 37, 18, 3, 10,].
If you want only single array..can be used:
A = [ 30, 25, 16, 32, 15, 37, 18, 3, 10] ;
  1 件のコメント
mrituanjay kumar
mrituanjay kumar 2020 年 3 月 5 日
Thanks

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeAnnotations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by