Missing values in cell array/ cellfun deltes space in Strings

2 ビュー (過去 30 日間)
Tim Krzyzanowski
Tim Krzyzanowski 2022 年 5 月 24 日
回答済み: Hiro Yoshino 2022 年 5 月 24 日
Hi everyone,
I am facing a problem with the cellfun function.
So first of all what i am doing.
I read in a excel file with the readcell function.
Thisis then a cell array mixed with strings and numbers. But also with some empty lines which leads to lines with 1x1 missing inside.
So i did the fix suggested from here and added this line under my read in:
param_table = cellfun(@rmmissing, param_table, 'UniformOutput', false);
But unfortunatly this code is deleting my spaces in the Strings: For example it changes Cell{2,2} from 'Simple text' to 'Simpletext'

回答 (1 件)

Hiro Yoshino
Hiro Yoshino 2022 年 5 月 24 日
You could read your excel by using app.
Go to MATLAB >> Home >> Import Data >> Import as table.
If you want to have more control of this import, you can generate the corresponding MATLAB code automatically from the App.

カテゴリ

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

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by