Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Basic Matlab Question, Urgent!! Please help!

Status
Not open for further replies.

ahmad_abdulghany

Advanced Member level 4
Advanced Member level 4
Joined
Apr 12, 2005
Messages
1,206
Helped
102
Reputation
206
Reaction score
22
Trophy points
1,318
Location
San Jose, California, USA
Activity points
11,769
Hello,

I have a variable got from the function: fgetl() , that variable contains rows like this:

a= 12345 6789

it contains many rows like the above, but it's not a two columns vector, but many columns,

when I type:
Code:
>> a' % to get the transpose of it
ans
1
2
3
4
5


6
7
8
9
>>

I want when i type a' it prints:
12345
6789

i.e. convert each batch of separate digits (or they're actually characters) into one number

Please help me ,
Thanks in advance,
Ahmad,
 

Hi Ahmad,

I still have difficulty to understand your real goal, so i'm sorry if my answer is not what you are looking for.

As you wrote at the end of your posting, i.e. you need to convert each batch of characters into one number, then maybe you need the matlab built-in str2num(). Please see the help on that function in matlab.

best
 
mimomod said:
Hi Ahmad,

I still have difficulty to understand your real goal, so i'm sorry if my answer is not what you are looking for.

As you wrote at the end of your posting, i.e. you need to convert each batch of characters into one number, then maybe you need the matlab built-in str2num(). Please see the help on that function in matlab.

best

Yeah!! :D
It solved the problem!! it was really what i want,

I did it via the str2num() function, as follows:
Code:
>>a='12345   6789';
>>b=str2num(a);
>>b'
ans
12345 
6789
>>

Check this link, it contains the original problem and it's now solved,


Regards,
Ahmad,
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top