Answered
Matlab plots only one point
You're performing matrix division instead of elementwise division. Use |./| instead of |/| in your |Y| calculation. Once that...

9 years ago | 1

| accepted

Answered
How to remove zeros from a 3D array
Well, you cannot remove a row of column from one page but not the other pages, so the loop does not make much sense. You coul...

9 years ago | 0

Answered
N-D matrix accumarray
Yes, |accumarray| will do it easily. You just need to generate the correct subscripts for it, which is the cartesian product of ...

9 years ago | 1

| accepted

Answered
problem in for loop
What is the point of having a matrix |mat1| twice the size it needs to be, storing lots of useless 0. Why not decouple the itera...

9 years ago | 0

Answered
How to assign array range to variable including the "end"-specifier?
Matlab cannot guess that when you write range = 2:end; The |end| means the end of another array, |B| in this case. In any...

9 years ago | 1

Answered
How to find a range of numbers of one matrix in another?
Assuming R2016b or later: B = [1:4000; (1:4000)/10]'; %demo data. 1st column is time, column 2 is output A = B(randi(siz...

9 years ago | 1

| accepted

Answered
I'm trying to implement an algorithm for prediction of missing nodes using Matlab. But, there are some errors in my coding , Could anyone please correct my code?
Note: the only part of _your_ code that works is actually the one I wrote in <https://uk.mathworks.com/matlabcentral/answers/330...

9 years ago | 0

Answered
Error: Retrieving the COM class factory for component with CLSID {9FF1D873-77F2-4743-99BA-6A5B8A361275} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
A 64-bit process will never be able to load a 32-bit COM dll as in-process. Windows simply does not allow it. The two could i...

9 years ago | 0

Answered
Passing a pointer from Matlab to C
Once again, it's C++ code, not C code. The code you've shown would not compile through a C compiler. You don't need to use |l...

9 years ago | 0

| accepted

Answered
can you give me any idea about how to use "find" command without using nested loops in matlab in this case??
The function you want is not |find| but <https://www.mathworks.com/help/matlab/ref/discretize.html |discretize|>, e.g: m = ...

9 years ago | 3

| accepted

Answered
New column in matrix based on condition from other matrix
[found, arow] = ismember(b, a(:, 1)); assert(all(found), 'some elements of b are not in a'); b(:, 2) = a(arow, 2);

9 years ago | 0

| accepted

Answered
Splitting image in matlab
Another way: [height, width, ~] = size(yourimage); splitimage = mat2cell(yourimage, [ceil(height/2), floor(height/2)], [...

9 years ago | 0

Answered
Iterate over specified dimensions in a matrix to find minimum value
There's absolutely no reason to use a loop. Use basic indexing to get the portion of matrix that interest you: N(1:dx, 1:dy...

9 years ago | 0

| accepted

Answered
Problems Sorting a Table using sortrows
You kind of inadvertantly answered your question in your title. The simplest way is to actually use a <https://www.mathworks....

9 years ago | 0

| accepted

Answered
Retrieve column vectors from table with correspondent names?
It does sound like <https://www.mathworks.com/help/matlab/ref/varfun.html |varfun|> is indeed what you need. For example, to ...

9 years ago | 3

| accepted

Answered
Parsing the Ms access data base
Well, I learnt something today. Access does allow <https://support.office.com/en-gb/article/Guide-to-multivalued-fields-7c2fd644...

9 years ago | 1

| accepted

Answered
How to create a directory using mobile number of a particular username..
Well, obviously, you need to convert the number to a string, which can be done with any of the many functions that do it: f...

9 years ago | 1

Answered
How to access data in structure by finding one of its elements?
First, don't use |diff| as a variable name since it will stop you using the very useful |diff| function. Secondly, it's alway...

9 years ago | 2

| accepted

Answered
sql query not working
You've given us a lot of irrelevant code. Your SQL query is: curs=exec(conn,'select mobile_num from user2 where uname IN(un...

9 years ago | 0

Answered
webwrite not send to right address
I'm hardly an expert but it looks like your web server is not configured properly. A |?| at the end of the URL, not followed by ...

9 years ago | 0

| accepted

Answered
turn matrix into function ?
There is an infinite number of functions that would fit the brief. Perhaps you're looking for a polynomial fit, a spline fit, or...

9 years ago | 2

| accepted

Answered
Why does Matlab constantly delete my graphic handles?
The normal behaviour of |plot| is to delete previous plots, unless |hold| is on. So, hold on either before the first |pl...

9 years ago | 0

| accepted

Answered
Find Minimum Value Between a specific column of a matrix and a vector
First issue with your code, you're storing the result of the |min| function into a variable called |min|. Any call to |min| afte...

9 years ago | 1

| accepted

Answered
find doesn't work with tables
You would save yourself a lot of headache if you used the variable names instead of numerical indices for accessing the content ...

9 years ago | 3

| accepted

Answered
How to substract an image?
This is simple matrix indexing: croppedimage = rgbimage(1:round(size(rgbimage, 1)*0.2), :, :) Alternatively, use <https:...

9 years ago | 0

| accepted

Answered
Cellfun to extract arrays from multi-dimensional cell
As Adam says, the loop version may be faster. With a few comments it also would be clearer. You're actually probably better off ...

9 years ago | 0

| accepted

Answered
How to compare one column of one matrix with all columms of other matrix one by one? matlab 2014b
R2016b or later: N - permute(M, [1 3 2]) Pre-R2016b: bsxfun(@minus, N, permute(M, [1 3 2])) will give you a 7x8x...

9 years ago | 1

| accepted

Answered
How I make this reshape?
m = [1 0 0 1 1 0 0; 1 1 0 1 1 0 0] reshape(m, [], 2)' That is res...

9 years ago | 0

| accepted

Answered
why dosen't this work ? i need a (:,4) cell. but 90 % of my result is empty spaces.
There's not much in your code that makes sense. First issue: if size(PLS{n, :}, 1) == 1 |PLS{n, :}| implies that |PLS...

9 years ago | 0

| accepted

Answered
How Can i write values in excel row by row??
Note: Any time you start numbering variables or naming them sequentially you should stop and rethink what you're doing. These va...

9 years ago | 0

Load more