Answered
Execute a for loop over a certain time period.
_Does anyone know how to make a loop that changes the year for a hundred iterations?_ I'm really not sure what you're asking....

9 years ago | 1

| accepted

Answered
how to solve uitable error?
It's most likely that the error comes from the 1st line. What are you trying to do with that line: da(1,2) = num2cell(horz...

9 years ago | 0

| accepted

Answered
Is it possible to automatically comment few lines of matlab code after sometime while the code is running ?
No, it is not possible to modify code while it is running. Unless your |if| expression is extremely complex, I wouldn't even ...

9 years ago | 1

| accepted

Answered
Help with matlab code to plot slope field
Well, you need a file called |SlopeField.m| somewhere in your matlab path. If you haven't got it, and can't get hold of it, ther...

9 years ago | 0

| accepted

Answered
Add element to the matrix in one sentence
If I understood correctly A = zeros(10,10); indices = [5,3,2,5,3,100,5]; values = [1,2,3,4,5,6,7]; A = A + resha...

9 years ago | 0

Answered
Finding similar values in matrices and removing them?
Assuming that the |x| values are not repeated in each matrix, and assuming that your weird notation (please use valid matlab not...

9 years ago | 1

| accepted

Answered
What is the most efficient way to fill a 4D array?
Assuming your |[j k l]| is supposed to be in the 4th dimension: [rows, cols, pages] = ndgrid(1:size(shift1, 1), 1:size(shif...

9 years ago | 0

Answered
Defining a 4d double
Well, you need 676^3 * 600^2 * 8 bytes ~= *890 TB of memory* to store that many elements, regardless of the shape. Chances are y...

9 years ago | 2

Answered
How to insert a Chart in Excel through Matlab
Not directly relevant to your question: I often see questions where people use |invoke| and |get| when dealing with COM. In most...

9 years ago | 1

Answered
How to create more cells within a cell in a cell array?
Notwithstanding that _I need to change some of these values to strings_ sounds very iffy (an arbitrary mix of numbers and string...

9 years ago | 0

Answered
Multiply each column by a elements of cell array
Conceptually it would make a lot more sense for your cell array to be a column rather than a row. Anyway, the easiest way to ...

9 years ago | 1

Answered
Matlab: function handle integration with several variables
A guess as I've not really tried to understand what your functions are doing: R = @(x_2) integal(@(x_1) S(x_1, x_2), a, c) ...

9 years ago | 1

Answered
How do i count unique elements in two table columns?
Simpler, using <https://www.mathworks.com/help/releases/R2017a/matlab/ref/rowfun.html |rowfun|> which did exist in R2015a: ...

9 years ago | 1

| accepted

Answered
How to merge cells within a table
No it's not possible to merge cells by row or even by columns. What you're seeing in the temperature column is not the merging o...

9 years ago | 0

| accepted

Answered
How do i sort table rows based on other table rows ?
sorting A according to B: [isinB, whereinB] = ismember(tableA.num, tableN.num); assert(all(isinB), 'some rows of A are n...

9 years ago | 0

Answered
insert NxM arrary into a cell in a table
There are <https://www.mathworks.com/help/matlab/tables.html#expand_panel_heading_1 many> ways of creating tables. One possible ...

9 years ago | 0

Answered
compare and group rows with remaining all rows of a matrix
I don't really understand what you mean by _if there is intersection_, so not sure if the following is correct. Yes, your mod...

9 years ago | 0

Answered
How to efficiently calculate item-based user similarity when there are huge number of users?
_But this code takes a huge time to finish running (about 2 hours to run on only 100 users!)._ No wonder! You're calculating ...

9 years ago | 1

Answered
How to compute median of neighboring pixels while using 3 x 3 sliding window?
Use <https://www.mathworks.com/help/images/ref/medfilt2.html |medfilt2|>: filteredimage = medfilt2(yourimage, [3 3]); No...

9 years ago | 0

Answered
compare and group rows with remaining all rows of a matrix
*Do not number variables.* Use cell arrays that can easily be indexed instead: M2 = [2093 1414 172 33; 1851 1416 1...

9 years ago | 0

| accepted

Answered
find the number of times a pair of value is a struct
One of many ways to do this: A = zeros(size(Clusters3, 1), size(o, 1)); for crow = 1:numel(Clusters3) for orow = ...

9 years ago | 0

| accepted

Answered
how can i delete unnecessary rows in a dataset?
A much simpler method t = readtable('test1.txt'); %optionally give name to columns with 'VariableNames' t(ismember(t{:,...

9 years ago | 1

Answered
How do I extract data from a matrix based on gaps in time?
First, a much simpler way to read your data: filename = 'Ferrari_Main.xlsx'; % Specifies the excel file ...

9 years ago | 0

Answered
How do I download Financial data from companies onto matlab?
Matlab does not have any built-in tools to extract data from generic pdf. I would think that it is because generically there's n...

9 years ago | 1

| accepted

Answered
Can someone explain what this chunk of code is doing (in layman's terms)?
It checks if there's a row of just 2 in both |totalcheck| and |behvchek|. If there is it appends |section_index{end}| (the squar...

9 years ago | 0

Answered
How to get two matrices with different element values from a mother matrix?
a1 = zeros(size(A)); a1(A == 1) = A(A == 1); Do the same for |a2| obviously replacing the |A == 1| by |A == 2|.

9 years ago | 0

| accepted

Answered
counting pixels within an image file
Most likely, your image is already greyscale. What is size(originalImageX) ?

9 years ago | 0

| accepted

Answered
Extract data based on columns
If your matrices are actually tables as your formatting sort of imply, then it's trivially done with <https://www.mathworks.com/...

9 years ago | 0

Answered
How to convolve an image of a*b*c with a filter of d*e*f?.For example an image of size 256*256*3 with a filter 49*49*38
Use <https://www.mathworks.com/help/matlab/ref/convn.html |convn|>? Although I don't see the point of a filter of size 38 in ...

9 years ago | 1

Answered
Assigning multiple values of a 3d matrix to another matrix
Use <https://www.mathworks.com/help/matlab/ref/sub2ind.html |sub2ind|> to convert your x, y, z into linear indices: Inew = ...

9 years ago | 0

| accepted

Load more