Answered
Array indexing-show wrong outputs
Note: There are way more powerful formatting functions than |num2str| and |strcat|, such as <https://www.mathworks.com/help/matl...

9 years ago | 0

| accepted

Answered
Manipulating a sub-matrix
You can't chain indexing operations, so you can either create a temporary variable subarr = arr(i:i+n-1, j:j+n-1); x = s...

9 years ago | 1

| accepted

Answered
how to use axis ?
_"when i tried axis([-0.3 0.3 -40 40]) it shows Subscript indices must either be real positive integers or logical"_ That err...

9 years ago | 0

| accepted

Answered
Normalize specific data in a table
You can work directly on the table using, for example, <https://www.mathworks.com/help/matlab/ref/varfun.html |varfun|>: yo...

9 years ago | 2

| accepted

Answered
Why a matrix component raised to power has a complex result ?
There's nothing surprising there. Raising a negative number to a fractional power often results in complex numbers. In fact, tha...

9 years ago | 0

| accepted

Answered
How do I make matlab read the files in order?
_" I have tried using natsortfiles() but I think I am not able to implement it properly."_ Something like this should work: ...

9 years ago | 1

| accepted

Answered
How to generate random integers from the uniform distribution between two numbers
Simply loop over the rows: result = zeros(size(A, 1), 1); for row = 1:size(A, 1) result(row) = randi(A(row)); e...

9 years ago | 0

Answered
How can I use bsxfun to replace for-loop in this code?
_"I want to use the function 'bsxfun' instead of inner for-loop"_ Rather than fixating on a function that may not be a solution ...

9 years ago | 0

| accepted

Answered
Undefined function 'sum' for input arguments of type 'struct' and Error in std.
As you've clearly shown, |x| is a structure. As the error message also clearly tells you, the |sum| function is not defined for ...

9 years ago | 1

| accepted

Answered
Is there a way to return a variable name from the variable value?
There is a way, but as Adam says the fact that you want this is an indication that your design is bad. vars = who; equa...

9 years ago | 0

Answered
How to get rid of this error when adding an element to the rows of a table?
You're probably using the slowest and most complicated way to create a table. tempslices = cellfun(@ctranspose, orderNewSli...

9 years ago | 1

| accepted

Answered
websave error when queryvalue contains "/"
_it looks like |/| is converted to %2F_ And that would be entirely correct and the right thing to do. The <https://tools.iet...

9 years ago | 0

| accepted

Answered
load structure array with a function and extract the variables
I did not understand exactly what you're trying to do. It sounds like you are trying to name your variables depending on the fil...

9 years ago | 0

| accepted

Answered
No histcountsmex function found
If you have matlab 2015, then you should use that version. If you do not, then I'm fairly certain that copying code from it i...

9 years ago | 1

| accepted

Answered
hi I need to do this act (5*(leftdigit%4)+2)%7
Going out on a limb and guessing that you got your formula from some C-like code, where the % is a modulo operator: mod(5 ....

9 years ago | 1

Answered
Find number of rows of each array in a cell
cellfun(@(c) size(c, 1), yourcellarray)

9 years ago | 1

| accepted

Answered
Constant properties in classes
Yes, constant properties can be calculated from other constant properties. It's the first example in the <https://www.mathworks....

9 years ago | 0

| accepted

Answered
How to extract a certain part from a string?
Assuming R2016b or later: extractBefore(yourstringarray, 9)

9 years ago | 1

| accepted

Answered
Function 'subsindex' is not defined for values of class 'cell'.
One possible way of generating your desired output: a = [1,0,1;1,1,0;1,1,1]; b = [0,1;1,0]; [rowa, rowb] = ndgrid(1...

9 years ago | 1

| accepted

Answered
Replacing Rows or Columns using Indexing (or efficient too solutions) instead of “Cat ”
Without changing |convms|, this is the best you can do: %Open the file filename= uigetfile ('.csv'); fileID = fopen ...

9 years ago | 0

| accepted

Answered
How to use MoveDown method to move down Tables?
I suspect you get an error because moving down one table is not valid in the current selection context (is there more than one t...

9 years ago | 1

| accepted

Answered
Looking for a function that would go from a point to an adjacent point in a direction in a matrix
A lot of if statements is never a good idea. You've actually named the solution in your question: _my idea of direction is an in...

9 years ago | 1

| accepted

Answered
sub2ind - get all of 3rd dimension
_EDIT:_ Note that this answer is completly wrong. See comments for proper answer. You don't need |sub2ind|, simply use: ...

9 years ago | 0

Answered
Error with xml files and Matlab structures
I'm not sure if it's a bug in matlab xml functions or in |struct2xml| but the problem is caused by nodes with empty text. |struc...

9 years ago | 3

| accepted

Answered
how we can declare and initialize matrix of different name of same size in for loop
It's a frequently asked question and the answer is always the same: <https://uk.mathworks.com/matlabcentral/answers/143-how-do-i...

9 years ago | 2

Answered
How to merge 2 data sharing 1 variable into a new one without using for-loop?
If all you want to do is create a new table with only the rows of |data2| that have a matching |secid| in |data1|, then no loop ...

9 years ago | 0

| accepted

Answered
How to change the positions of elements in a vector?
v = [v(v ~= 3), v(v == 3)]; %assuming a row vector. If column vector replace , by ;

9 years ago | 2

Answered
What's the upper limit for how much data can be stored in a structure?
Your code is a bit confusing with all these apparently useless |strcat| (see comment to the question). Anyway, to answer your...

9 years ago | 0

| accepted

Answered
How to concatenate multidimensional struct arrays
Right, so you do have instances of classes, A of class |segment| and B of class |segment2| (poor naming) in package |elements|. ...

9 years ago | 2

| accepted

Answered
I couldn't obtain a plausible plot. I wonder if you can help me with this problem.
Your question is confusing. You're saying that you're not getting the right results, yet show an error message which would mean ...

9 years ago | 1

Load more