Answered
Error using reshape To RESHAPE the number of elements must not change.
|LocalMean| *must* have |size(V,1)^2| elements for your |reshape| to work. As the error message tells you, it hasn't. Since we h...

8 years ago | 0

Answered
How can I merge the numbers in matrix on each row?
A = [20090 9 27 1000; 4 5 8 1] %demo sum([10.^cumsum(1+floor(log10(A(:, 2:end))), 2, 'reverse'), ones(size(A, 1), 1)] .*...

8 years ago | 0

| accepted

Answered
read and search an excel file with Arabic or Persian column
With R2018b, It looks like your spreadsheet can be read correctly using either |xlsread| or |readtable|. [~, ~, raw] = xlsr...

8 years ago | 1

| accepted

Answered
accessing all elements along the diagonals and rows (simple backprojection algorithm for image reconstruction)
You can indeed use convolutions: m = reshape(1:100, 10, 10); %demo matrix convlength = 2 * size(m, 1); %also 2 * siz...

8 years ago | 1

| accepted

Answered
How to find a unique RGB value in a picture
[row, col] = find(all(yourimage == permute([R G B], [1 3 2]), 3)) where [R G B] is the looked for RGB value.

8 years ago | 0

Answered
Unwanted "ans" in my output
This is what you see when you write your code in matlab's editor <</matlabcentral/answers/uploaded_files/137083/editcode.png>...

8 years ago | 1

Answered
Generation of a matrix based on a defined order of numbers
One way to do it: v1 = [2 3 4 5 6 7 8 9]; v2 = [3 4 5 6 7]; pick1 = nchoosek(v1, 2)'; idx1 = hankel([1 1 1 1 2],...

8 years ago | 1

| accepted

Answered
how to express vector in the form of a polynomial?
The first problem with your vector is that it doesn't appear you've left any room for the polynomial constant. A polynomial of d...

8 years ago | 0

Answered
How to show an image from a textfile?
jpg images are typically colour images. Colour images are stored as *3D arrays* in matlab. |dlmread| and |dlmwrite| can only rea...

8 years ago | 1

| accepted

Answered
Convert Adjacency list of graph into Adjacency matrix
One possible way to read your file: lists = strsplit(fileread('list.txt'), {'\r', '\n'}); if isempty(lists{end}), lists ...

8 years ago | 0

Answered
Matrix dimension must agree error
_I do not know why is this happening_ |Allresult| is 1x16, |Noise| is 1x48(assuming it didn't exist before you create it). Of...

8 years ago | 1

| accepted

Answered
Plot Connecting at both ends
matlab plots exactly what you give it. I can see only two curves plotted in your screenshot. The reason they would wrap back fro...

8 years ago | 1

Answered
Convert hour, minute, and day to fraction of a day
The easiest is to use the <https://www.mathworks.com/help/matlab/ref/days.html |days|> function with a |duration| object: >...

8 years ago | 0

| accepted

Answered
How to compute the velocity of moving centroids ? How analyze one centroid only among others ?
Tracking the displacement/velocity of points through a video is a well established problem with extensive litterature. The two t...

8 years ago | 0

Answered
How to make a scale-able structure array with variable values
I'm not entirely clear on the reasons behind your question and it does sound like you're trying to fit the language around an il...

8 years ago | 0

Answered
What would happen if the time for function execution is bigger that the t.Period using timer object
It's completely documented in the <https://www.mathworks.com/help/matlab/ref/timer-class.html |timer|> documentation and the beh...

8 years ago | 2

Answered
re-order array structs of arrays
Convert to cell array with |struct2cell|, then to matrix, rearrange the dimension, and convert back to cell array then structure...

8 years ago | 0

Answered
How to eval an expression without an error?
Not withstanding that using |eval| is a *really bad idea*, if you do really want to do it and not stop on error, wrap it in a <h...

8 years ago | 0

Answered
I am using the Matlab object vision.VideoFileWriter to create a movie in avi format. The default value of the movie size is 720 x 480 pixels. I would like to create a larger movie-can this be done?
The size of the video is the size of the images you pass to |VideoFileWriter|, there is no default. If you want a different vide...

8 years ago | 0

| accepted

Answered
How to get statistical summary
The way I'd do this is first convert your cell array to a <https://www.mathworks.com/help/matlab/ref/table.html table> whose fir...

8 years ago | 1

| accepted

Answered
arrayfun with multiple inputs and a different size output
Note: I'm not familiar enough with GPU computing to know if there are some restrictions that apply. _First issue: myfunc is ...

8 years ago | 1

| accepted

Answered
Best way to sort a 3-d matrix by one column?
You can't use |sortrows| on a 3D matrix. You have two options: * Use a loop and use |sortrows| on the pages: for page = ...

8 years ago | 0

Answered
Sorting data from table
Simple: sortedtable = sortrows(yourtable, 'year', 'flowrate', {'ascend', 'descend'}) %sort ascending by year, and for iden...

8 years ago | 0

Answered
converting a decimal number to its binary.
The easy way to find the binary representation of a double number in matlab: number = 753.153; %for example dec2bin(typ...

8 years ago | 0

Answered
How can I add " " to first row and column in a cell
Adding the headers to your cell array as you require is trivial: newcellarray = [{}, compose('"%d', 1996:2014); compose('"%...

8 years ago | 0

| accepted

Answered
count even elements vector
Isn't it trivial? Using |sum|: sum(mod(myvec, 2) == 0) Or using |nnz|: nnz(mod(myvec, 2) == 0)

8 years ago | 0

| accepted

Answered
How to set table VariableNames from a cell?
Right, this is one case of a badly explained problem and one case of a user not really understanding the error message he's give...

8 years ago | 0

Answered
How can I make this code run faster and what is going on in it all
Despite what the misspelled and barely understandable comment says, you can use a convolution to replace the loop Ifx = con...

8 years ago | 0

Answered
How to read specific data from text file between 2 lines
The proper way to do this: Your file is not a text file but an xml file. Use <https://www.mathworks.com/help/matlab/ref/xmlread....

8 years ago | 0

Answered
A variable index must be a real positive integer Issue in app designer
_Could it be that the fields drop down values are empty before the data is imported?_ It's simple to check using the <https:/...

8 years ago | 0

| accepted

Load more