[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #63383] Error in sscanf in special cases when
From: |
José Luis García Pallero |
Subject: |
[Octave-bug-tracker] [bug #63383] Error in sscanf in special cases when '%f' conversion is used |
Date: |
Fri, 18 Nov 2022 09:34:48 -0500 (EST) |
URL:
<https://savannah.gnu.org/bugs/?63383>
Summary: Error in sscanf in special cases when '%f'
conversion is used
Project: GNU Octave
Submitter: jgpallero
Submitted: vie 18 nov 2022 14:34:46
Category: Octave Function
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Incorrect Result
Status: None
Assigned to: None
Originator Name: jgpallero
Originator Email:
Open/Closed: Open
Release: other
Discussion Lock: Any
Operating System: Any
_______________________________________________________
Follow-up Comments:
-------------------------------------------------------
Date: vie 18 nov 2022 14:34:46 By: José Luis García Pallero
<jgpallero>
When I use the text string
>> a = '1 2 3 t';
in sscanf in order to extract the elements using '%f' I obtain obviously an
error message due to the last element:
>> [elements,n,msg]=sscanf(a,'%f')
elements =
1
2
3
n = 3
msg = sscanf: format failed to match
But if the last element is the letter 'n':
>> a = '1 2 3 n';
>> [elements,n,msg]=sscanf(a,'%f')
elements =
1
2
3
n = 3
msg =
Only three elements are extracted, as expected, but the error message is not
set, so this can not be used to check for errors (Matlab gets the error
message). The proplem is present, I think, only with letter 'n'.
If I use '%d' as conversion there is no problem:
>> a = '1 2 3 n';
>> a = '1 2 3 n';
>> [elements,n,msg]=sscanf(a,'%d')
elements =
1
2
3
n = 3
msg = sscanf: format failed to match
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?63383>
_______________________________________________
Mensaje enviado vía Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #63383] Error in sscanf in special cases when '%f' conversion is used,
José Luis García Pallero <=