1990 年から 1999 年のデータに対応するインデックスのベクトルを作成し、変数 idx に保存したいです
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
めぐみ
am 15 Mai 2025
Beantwortet: Kojiro Saito
am 15 Mai 2025
matlab 部分行列の抽出と修正ベクトルの複数の要素を抽出する(2/3) 10 年分のデータの抽出
の問題の解答が無く進められません。回答を教えていただけますか?
load eurGasPrices
Fr2 = France(2);
France(1) = Fr2;
plot(Year,France)
hold on
plot(Year,Germany)
hold off
title("Gasoline Prices in USD/gal over time")
legend("France","Germany")
0 Kommentare
Akzeptierte Antwort
Kojiro Saito
am 15 Mai 2025
「解答を表示」をクリックしてもdecadeAnalysisSoln1.mlxというファイルが表示されませんでしょうか?
解答は
idx = 1:10;
です。
idx = 1990:1999と書きたくなるところですが、トリッキーな問題でして、ヒントを表示すると該当データが最初の1番目から10番目のインデックスになっていることが書かれています。
ヒント
1990 年から 1999 年までのデータは、各ベクトルの最初の 10 個の要素にあります。したがって、1 から 10 までのインデックスのベクトルを作成する必要があるということです。
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu 時系列イベント finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!