How to Keep Rows and Columns headers when applying matrix Operation in matlab?

1 回表示 (過去 30 日間)
dear experienced:
I have dataset stored in matlab, which contain 100+ rows (instances) and 20 columns (features), i have read data used
A= xlsread(filename);
when i need to apply such operation like :
Anorm =normc(A) [ normalized matrix of original matrix A]
then when i write normalized matrix, i would to keep the rows and columns headers as its in original matrix, following image just show an example used to explain my instances names and variable names.
My question: how we can apply such previous functions and keep rows and columns headers of matrix?
example of input .. and output matrix ..

採用された回答

Image Analyst
Image Analyst 2017 年 1 月 7 日
That is not a dataset variable. num is a double matrix, and txt and raw are cell arrays.
You can transpose any of them. But what does it mean to compute the distance transform of a cell array of strings? Or of a cell array?
  6 件のコメント
ahmed obaid
ahmed obaid 2017 年 1 月 8 日
編集済み: ahmed obaid 2017 年 1 月 8 日
excellent, its work very fine .. only one doubt please: is this code normalize vectors in independent way? in other words max value is calculated over all matrix or independent for each vector ?
Image Analyst
Image Analyst 2017 年 1 月 8 日
It looks over the entire 2-D matrix and finds the min and max, then sets the min to 0, the max to 1, and everything in between is scaled linearly. It does not find minima and maxima on a row-by-row or column-by-column basis. For that, you'd have to call mat2gray with just one row or column and loop over rows or columns.

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by