異なる列数の行列の連結について

7 visualizzazioni (ultimi 30 giorni)
健気 大川
健気 大川 il 7 Mag 2021
Commentato: 健気 大川 il 27 Mag 2021
図のように、B,C,D,EをまとめてG列のようにしたいです。B,C,D,Eは異なる列数です。どなたか助言お願いします。

Risposta accettata

Hernia Baby
Hernia Baby il 7 Mag 2021
数字だけでしたので、とりあえず数字のみ整列させます。
文字列も取り扱いありますが、stringに変えるだけなので大体同じです。
エクセルデータも添付しておきます。
clc,clear,close all;
% 数値だけ読み込む
[~,~,A] = xlsread('test4matlab.xlsx');
% 1列にまとめる
A = A(:);
% Aのデータ型をcellからdoubleへ
A = cell2mat(A);
% NaNが邪魔なので消す
ANS = rmmissing(A)
ANS =
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
  1 Commento
健気 大川
健気 大川 il 27 Mag 2021
お忙しい中、ありがとうございます!解決いたしました!

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Creating and Concatenating Matrices in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!