Troubles With Spaces - Convert Some Messy Data Into A Clean Array - MATLAB Cody - MATLAB Central

Problem 58827. Troubles With Spaces - Convert Some Messy Data Into A Clean Array

Difficulty:Rate
I have a bunch of messy data I have to go through. The data is stored in an odd format, so str2num isn't working. And even when I get it to work, it is still too slow!
I need you to turn the strings into numbers. Any '+++++++' values are values that overloaded the data collection device and should be set to NaN.
'- 6.496' => -6.496
'-10.430' => -10.430
'+++++++' => NaN
'+11.664' => 11.664
Oh, and output it into an array because I hate working with cells. And there's a lot of data so it had better be fast!

Solution Stats

100.0% Correct | 0.0% Incorrect
Last Solution submitted on Oct 02, 2023

Problem Comments

Solution Comments

Show comments
PIVlab surpasses 100K all-time File Exchange downloads
During the past twelve months, PIVlab, a MATLAB Community Toolbox for particle...
4
8
LLMs with MATLAB updated to support the latest OpenAI Models
Large Languge model with MATLAB, a free add-on that lets you access...
2
4

Problem Recent Solvers3

Suggested Problems

Community Treasure Hunt

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

Start Hunting!