Answered
separation of similar strings in cell array and store in different variables?
One way: [~, ~, subs] = unique(data1(:, 1)); var = accumarray(subs, (1:size(data1, 1)).', [], @(rows) {data1(rows, :)})

7 years ago | 1

| accepted

Answered
Help with a basic MATLAB question
Given a positive integer, e.g. x = 749623, you're supposed to decompose it into a vector of digits, for my example y = [7, 4, 9,...

7 years ago | 2

Answered
Fastest way to find number of times a number occurs in an array?
Assuming that your clusters are integer numbers from 1 to N with no gaps: count = accumarray(1, X(:, 2)); If not, [cluster, ~...

7 years ago | 1

Answered
Why using actxserver will turn my file to read-only
The line cRowNames = templateExcel.Properties.RowNames; would imply that templateExcel is a matlab table. Yet on the previous ...

7 years ago | 0

Answered
How can i resloved this problem ?
The lack of comments, the unnecessary brackets and the meaningless variable names make your code harder to read than it should b...

7 years ago | 0

| accepted

Answered
readtable splits content of file in multiple columns
readtable has lots of heuristics to try to determine the actual format of your file (has it got a header? how many lines is the ...

7 years ago | 1

| accepted

Answered
Replacing the non zero values of matrix by another values based on some criterion.
If I understood correctly, A = [1 0 0 0; 0 0 12 0; 0 2 0 0; 8 0 0 0; 0 9 0 0; 0 0 0 8; 4 0 0 0; 0 0 0 3; 0 5 0 0; 0 0 6 0]; ...

7 years ago | 0

| accepted

Answered
2 Loops of same size, 1 goes very quick but one is very slow.
Here is a simple way to create your A (the one with +1 and +2) [v1, v2] = ndgrid(num2cell(eye(110), 2)); %110 is 10*11 vsum =...

7 years ago | 0

| accepted

Answered
Display struct array as a table
struct2table does that: >> %--- Define stuct array 'sites' ---% sites(1).code = 'LP5'; sites(1).name = 'Liverpool'; sites(1)...

7 years ago | 0

| accepted

Answered
Error:Conversion to cell from logical is not possible.
It's difficult to follow a conversation when some comments have been deleted... I cannot see any table in any of the code that h...

7 years ago | 3

| accepted

Answered
how to compare an array to a table
"well that's also a problem i'm facing hoping to find help" It's difficult for us to help you when you're being very evasive ab...

7 years ago | 0

Answered
Change dimensions of a cell depending on the number of inputs
I'm assuming that your cells will not be individual variables (impossible to work with) but stored for example in another cell a...

7 years ago | 0

| accepted

Answered
Running python script in matlab and see life results
Why not call the python code directly from matlab without passing through the command line?

7 years ago | 0

Answered
sorting a list by position
[newo, order] = sort(o, 'descend'); newp = p(order);

7 years ago | 0

| accepted

Answered
Convert C++ code in Matlab code?
The code you show is hardcoded to check only matrices of size 5x4 and hardcoded to only check one matrix. Hardly useful. In any...

7 years ago | 0

Answered
Is there a way for me to figure out the truncation error of the following sum using MATLAB? Is there a function I may write to calculate this?
As long as your sum is smaller than flintmax (9,007,199,254,740,992) there will be no error. From flintmax to 2*flintmax the err...

7 years ago | 0

| accepted

Answered
Is there a way to combine two variables?
If the order in AB is not critical, as long as elements of A are matched with elements of B: AB = [A(:), B(:)]; If you absolut...

7 years ago | 2

| accepted

Answered
Vectorizing a nasted loop
DataChunk = reshape(Raw.RAW, Window, Chunks); TimeChunk = reshape(Raw.Time, Window, Chunks); That's assuming that RAW and Time...

7 years ago | 1

Answered
Delete a row from a matrix and save it in a new matrix
Just copy the row before deleting it. After you've deleted it, it's gone for good and can no longer be retrieved. B = A(2, :); ...

7 years ago | 0

Answered
how is the average 10 minutes to hours ?
The simplest way to achieve what you want is to forget about all these outdated tools such as datenum, histc, etc. and convert y...

7 years ago | 0

Answered
Error in reading text file and implemeting conditional logic to it
I don't have the stats toolbox and so have never used tdfread. You file can be easily read by readtable which doesn't require an...

7 years ago | 0

Answered
'The variable appears to change size on every loop iteration' Error is shown.
Documentation on preallocation which explains why you're seeing this. As Bob Nbob said, to make it go away, preallocate your ar...

7 years ago | 2

| accepted

Answered
What does this code do?
find with one output argument return a vector of linear index. If you give it two output arguments, it returns a row and column ...

7 years ago | 1

| accepted

Answered
Matlab connection with device by .net library by .dll
It's actually fairly easy to call .Net functions from matlab. No you don't need a header file for Net assemblies (these don't ex...

7 years ago | 2

Answered
How to Matrix Multiply instead of a for loop?
I can't see a way to do that without a loop. The following is fairly efficient: A = rand(4) %demo matrix n = 10; %demo data ...

7 years ago | 0

Answered
How can I read a huge json file (0.5GB)
The problem is that your computer simply doesn't have enough memory.What does memory says after you've simply started matlab? H...

7 years ago | 1

Answered
How to get an array of external bits in matlab gui?
I have no idea what an array of external bits is. Furthermore, you've posted a wall of code with not a single comment explainin...

7 years ago | 0

Answered
Any one let me know whats wrong with this code
I've not looked past these three lines: [Background_hsv]=round(rgb2hsv(Background)); [CurrentFrame_hsv]=round(rgb2hsv(CurrentF...

7 years ago | 0

Answered
How to read .png image from a folder iteratively?
The problem is obvious once you've seen the code in your other question that you've used to create these images. These images ar...

7 years ago | 0

| accepted

Answered
Why does matlab allow array indexing by a string by converting them into ascii codes?
In many languages, and certainly in the majority of languages when matlab was created, the character type is just an alias for a...

7 years ago | 1

| accepted

Load more