Answered
Read data from cell---structure--multiple fields to table
Not 100% sure of your description, but this might be what you want: >> for i=1:3, c{i} = struct('a',i,'b',100+i); end >>...

11 years ago | 1

| accepted

Answered
How do I change a string or number in a table?
Mathilde, I think with that syntax, you just need to wrap that string in curly braces in order to assign it into a variable that...

11 years ago | 4

Answered
How to reshape efficiently Panel Data
This is a one-liner using the unstack function on a table. It would be something like wideData = unstack(tallData,{'Price' ...

11 years ago | 0

Answered
the number of occurences of each character of one string,in another
Another possibility: >> s = 'MEQNGLDHDSRSSIDTTINDTQKTFLEFRSYTQLSEKLASSSSYTAPPLNEDGPKGVASAVSQGSESVVSWTTLTHVYSILGAYGGPTCLYPTA...

11 years ago | 2

Answered
kmeans works with some values of k and not works with other
If f1 is a binary matrix, then it certainly does make sense to cluster your data into more than two clusters. Each column of f1 ...

11 years ago | 0

Answered
Select August data from a vector column in the format YYYYMMDD
Are the dates strings, or numbers? If you have access to R2014b, you could do either of these, depending on which you have: ...

11 years ago | 0

Answered
Time of day deduction
If you have access to R2014b, the new duration data type will help: >> d = seconds(0:40:180) d = 0 secs 40 s...

11 years ago | 2

Answered
how to get randomization seed ?
Joe, I think you want the random number state, not the seed. RNG will give you both. You description is a little vague, but I...

11 years ago | 1

| accepted

Answered
random number generator to two different variables
cgo, it may be that you have created a variable called "rand" in your workspace that is shadowing the rand function. The rand fu...

11 years ago | 1

Answered
Converting strcat to use with categoricals
Andreas, I think the categorical times method is you're looking for: >> tab = table(categorical({'true','false','false','nu...

11 years ago | 0

| accepted

Answered
Combining Date and Time variables (class - datetime) into 1 DateTime (class - double) array
Jenny, if you create datetimes from strings and don't specify the time portion, it defaults to midnight. If you don't specify th...

11 years ago | 0

Answered
Processing a HUGE number of timestamps
none, I don't know if you have access to R2014b. If you do, consider using the new datetime data type. On a not so fast PC, pars...

11 years ago | 2

Answered
Monthly average from time series with daily values
K_r1, if you have access to MATLAB R2014b, there are some new data types that make this more straight-forward: >> dt0 = dat...

11 years ago | 0

Answered
How to union columns in the same Variable (Array) ?
I think you are looking for UNIQUE.

11 years ago | 0

Answered
1-hour offset in time string conversion
Dennis, I'm guessing you're somewhere in Europe, and that Star Strider is somewhere in the western US. As in, UTC+1 and UTC-7. ...

11 years ago | 1

| accepted

Answered
Performance of table data type
Michael, table is currently not as fast as datatypes like double and cell when you are reading or writing individual values in a...

11 years ago | 3

Answered
How to access the data type of the each column of a table
Ege, your question isn't all that clear. But I'm guessing that you don't want to be looping over every element of the table and ...

11 years ago | 11

| accepted

Answered
Converting Covariance Matrix to Correlation Matrix
Jim, if you mean, "matrix operations" as in "something out of a math book", then you can right and left multiply by diag(d), whe...

11 years ago | 0

Answered
Checking if two random variables are statistically independent
Erin, consider the following analogy: generate 10 random values form a standard normal distribution. >> x = randn(10,1); ...

11 years ago | 0

Answered
setdiff error in some cases
Neesha, this appears to be a bug when one of the datasets has zero rows and the other has exactly one. A valid edge case to be s...

11 years ago | 0

| accepted

Answered
Random Number Generation for Parallel Computing Toolbox
If I'm understanding correctly, the problem is that, just as with ordinary non-parallel MATLAB, the random numbers on each worke...

11 years ago | 0

Answered
Creating a Matrix with Datenum column and a string column.
Davin, as others have said, you have a cell array. That's one way you can store data of different types in one array, but it may...

11 years ago | 0

Answered
Difference between mvnrnd(,sigma) and randn()*chol(sigma)
Did you forget to reset the random number generator between the two calls? mvnrnd and randn draw random values from the same str...

11 years ago | 1

| accepted

Answered
access values in dataset
Slightly more direct than Mark's suggestion: Im.Coefficients.Estimates(1) gets you the estimated intercept as a scalar v...

11 years ago | 0

Answered
Why the trigonometry results are different
1.6331e+16 is the right answer. Remember that pi/ is irrational. There is no way to represent it in double precision. The tangen...

11 years ago | 1

| accepted

Answered
Clever solution sought: Summing values from an array into a vector component given in a second array
I think you are looking for accumarray.

11 years ago | 0

| accepted

Answered
Can matlab functions return a table?
Asghar, in recent versions of MATLAB, there's a data type called "table". You may be asking about that. Here's a simple example ...

11 years ago | 0

Answered
Is there a way to plot original set of data onto biplot?
Michelle, the whole point of PCA is to create a new coordinate system. Plotting the original data in that coordinate system does...

11 years ago | 0

| accepted

Answered
KSdensity 2D density histogram plot
It does make plots like the ones you pointed to, as demonstrated by the images on the FEX download page. You've provided no info...

12 years ago | 0

Answered
KSdensity 2D density histogram plot
Rebecca, you might look at this File Exchange submission: http://www.mathworks.com/matlabcentral/fileexchange/13352-smoothhis...

12 years ago | 0

Load more