load matrix with variable from text file using fileread

1 Ansicht (letzte 30 Tage)
polo Mahmoud
polo Mahmoud am 15 Feb. 2020
Hi I have a matrix eg :
[ 1 2 3 J
4 5 6 J];
I want to load this into matlab but the letter turns into NaN, i want to import the matrix into matlab then herafter ( in Matlab) define/give a value to ( J )
eg:
J = 2
I have used fileread, which is good for numbers, but turns letters to NaN
  1 Kommentar
Giuseppe Inghilterra
Giuseppe Inghilterra am 15 Feb. 2020
Can you attach a txt file sample? When I use fileread on my own I obtain a character vector and I don't have the behaviour (NaN values) that you have described.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Characters and Strings finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by