|
|
Reading data from a variable matrix
Is it possible to read through the data in a variable matrix and allocate it to memory? Much like what would be done when reading a file? I need to read all of the values of a 1x1900 matrix, then count how many times each number from 1-120 is in the matrix.
|
|
0
|
|
|
|
Reply
|
see.me.trot (7)
|
6/15/2012 8:05:09 PM |
|
On 6/15/2012 3:05 PM, Ellen wrote:
> Is it possible to read through the data in a variable matrix and
> allocate it to memory? Much like what would be done when reading a file?
> I need to read all of the values of a 1x1900 matrix, then count how many
> times each number from 1-120 is in the matrix.
doc histc
--
|
|
0
|
|
|
|
Reply
|
none1568 (6639)
|
6/15/2012 9:00:27 PM
|
|
On 6/15/2012 3:05 PM, Ellen wrote:
> Is it possible to read through the data in a variable matrix and allocate
>it to memory? Much like what would be done when reading a file? I need
>to read all of the values of a 1x1900 matrix, then count how many
>times each number from 1-120 is in the matrix.
I am not sure I understand. When you write
A=rand(5,1)
A is now in memory, it is not on disk?
You can iterate over it, since it is in memory using a 'for'.
But you do not really need to. You can use let Matlab
do the hard work. You sit back and relax
example
--------------------
EDU>> A
0.8147
0.9058
0.1270
0.9134
0.6324
EDU>> A( (0 <= A) & (A< 0.5) )
0.1270
--------------------
--Nasser
|
|
0
|
|
|
|
Reply
|
Nasser
|
6/15/2012 9:13:56 PM
|
|
On 6/15/2012 4:00 PM, dpb wrote:
> On 6/15/2012 3:05 PM, Ellen wrote:
>> Is it possible to read through the data in a variable matrix and
>> allocate it to memory? Much like what would be done when reading a file?
>> I need to read all of the values of a 1x1900 matrix, then count how many
>> times each number from 1-120 is in the matrix.
>
> doc histc
>
Small example...
>> x=fix(10*rand(1,10))
x =
2 8 2 8 9 2 2 0 0 6
>> min(x):max(x)
ans =
0 1 2 3 4 5 6 7 8 9
>> histc(x,[min(x):max(x)])
ans =
2 0 4 0 0 0 1 0 2 1
>>
--
|
|
0
|
|
|
|
Reply
|
none1568 (6639)
|
6/15/2012 9:17:53 PM
|
|
|
3 Replies
36 Views
(page loaded in 0.074 seconds)
Similiar Articles: Reading ASCII text file with variable number of columns - comp ...Hi, I have an all-string, tab-delimited ASCII text file of the form: % Begin File % Xaxis1 Xaxis2 XaxisN Name1 Name2 ... Incorporating data from a variable in xlswrite filename - comp ...Hi, I'm putting together a little file to read data from an XLS, conduct ... for the user to select the source XLS, and currently this writes a variable called "Data ... Reading/writing data to/from files into 2D array - comp.lang.vhdl ...... array is array (1 to 2,1 to 2) of integer; variable Y : Y_array; begin while not endfile (data ... Reading matrix data to 2d array - Dev ... How to read file into a ... Inserting variable size data from matlab to Excel files - comp ...If my matrix size is 20X366,it is difficult to calculate the ... importing and exporting to excel MATLAB® will read in the Excel data and assign it to the variable name of ... read base workspace from function workspace - comp.soft-sys.matlab ...Hi, i want to know if there is any way to read variables ... many of the base ... way -- on a Mac! -- to read ... data ... load matrix from workspace to simulink - comp.soft ... Reading mat file in C++ (VS) - comp.soft-sys.matlabOpening MAT Files - comp.soft-sys.matlab Read data from MAT-file - Simulink ... Create a Cell Array for Each System.Object Create MATLAB Variables from the .NET Data ... GUIDE how to create a Global variable in GUDIE .m file - comp.soft ...Hi all, may i know how can i create a global variable in Guide generated .m file ... Hello, I created a GUI using Matlab GUIDE do read in data from Excel files. Storing Matlab Variables in A BLOB column - comp.soft-sys.matlab ...... to store Matlab variables as binary data in ... indeed store the data into a cell ... Reading text values into matlab variables ... trying to store a matrix of doubles ... Data ... Reading Hex data to text. - comp.soft-sys.matlab... to matlab, and am just having some trouble reading in part of a data ... Reading ASCII text file with variable number of columns - comp ... Reading Hex data to text. - comp ... Reading a large mixed CSV file of unknown types and size - comp ...... Gross domestic product') in that variable and then convert the asscoiated data to ... contents of the CSV i= nto a cell/ matrix ... unknown types and size - comp ... read data ... READ MATRIX TO VARIABLESREAD MATRIX TO VARIABLES Name: READ MATRIX TO VARIABLES Type: Input Command Purpose: Reads matrix data into a response variable, a row-id variable ... Reading data from a variable matrix - Newsreader - MATLAB CentralIs it possible to read through the data in a variable matrix and allocate it to memory? Much like what would be done when reading a file? I need to read all of the ... 7/13/2012 4:30:52 PM
|
|
|
|
|
|
|
|
|