Respondida
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...

más de 7 años hace | 0

Respondida
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)] .*...

más de 7 años hace | 0

| aceptada

Respondida
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...

más de 7 años hace | 1

| aceptada

Respondida
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...

más de 7 años hace | 1

| aceptada

Respondida
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.

más de 7 años hace | 0

Respondida
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>...

más de 7 años hace | 1

Respondida
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],...

más de 7 años hace | 1

| aceptada

Respondida
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...

más de 7 años hace | 0

Respondida
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...

más de 7 años hace | 1

| aceptada

Respondida
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 ...

más de 7 años hace | 0

Respondida
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...

más de 7 años hace | 1

| aceptada

Respondida
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...

más de 7 años hace | 1

Respondida
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: >...

más de 7 años hace | 0

| aceptada

Respondida
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...

más de 7 años hace | 0

Respondida
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...

más de 7 años hace | 0

Respondida
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...

más de 7 años hace | 2

Respondida
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...

más de 7 años hace | 0

Respondida
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...

más de 7 años hace | 0

Respondida
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...

más de 7 años hace | 0

| aceptada

Respondida
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...

más de 7 años hace | 1

| aceptada

Respondida
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 ...

más de 7 años hace | 1

| aceptada

Respondida
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 = ...

casi 8 años hace | 0

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

casi 8 años hace | 0

Respondida
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...

casi 8 años hace | 0

Respondida
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('"%...

casi 8 años hace | 0

| aceptada

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

casi 8 años hace | 0

| aceptada

Respondida
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...

casi 8 años hace | 0

Respondida
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...

casi 8 años hace | 0

Respondida
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....

casi 8 años hace | 0

Respondida
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:/...

casi 8 años hace | 0

| aceptada

Cargar más