Answered
Divide matrix in to vectors using for-loop
_"The values in my matrix is the monthly developement of the stock market. My final result is a table displayed in the command w...

9 years ago | 1

Answered
Expanding Matrix with Integers (between decimal numbers)
_"But how to create T_new?"_ An option: T_integer = round(T); T_new = union(setdiff(min(T_integer):max(T_integer), T_...

9 years ago | 1

| accepted

Answered
How to underline the following text in sprintf
Officially, the command line display does not support any kind of formatting (underline, bold, etc.). Saying that: disp(...

9 years ago | 0

Answered
in gui design i have text gui component . i have write 1000 value (1,2,3,...1000)in between i have stop by program by close button than i got error text object not destroy how to remove this error
I don't understand what you're saying in the title of your question but the error message is very clear: you're trying to set th...

9 years ago | 0

| accepted

Answered
Indexing a vector and getting rid of empty spaces
1. |find| is totally unnecessary in your original code. The following would produce the same result: Indices1 = Y_Pos>400 |...

9 years ago | 0

Answered
Why am I getting this error?"Error using input The first argument to INPUT must be a character vector. Error in HailstonePath (line 4) input(num);"
There is a *{}Code* format button to format code as such. Please use that rather than the near unreadable mess that you've writt...

9 years ago | 0

Answered
Storing data as binary strings
binarystream = fileread(yourfile); waveform = bin2dec(strsplit(binarystream)); should work and is very simple. That is a...

9 years ago | 2

Answered
Error using ==> fprintf Function is not defined for 'cell' inputs.
As the error message says, you can't pass cell arrays to |sprintf|. It doesn't know what to do with them since they can contain ...

9 years ago | 0

Answered
Summing matrices in cell arrays within a certain range
|cellfun| apply the same operation on *each* element of the cell array and returns an output for each of these. Therefore, it ca...

9 years ago | 0

| accepted

Answered
Getting max and min values in a day for data for 8 months
There are plenty of ways of doing this which does not require loops. If you did not require the index of the max, the simples...

9 years ago | 3

| accepted

Answered
Struct contents reference from a non-struct array object. error in a code
Your code is expecting that the |sroot| variable, which presumably gets popped into existence by your |load(strcat('tree',sprint...

9 years ago | 0

| accepted

Answered
How replace the duplicated row by the mean
Assuming that there is more to your question, and that your input is actually a matrix where one of the column has got the index...

9 years ago | 0

| accepted

Answered
import a text file into a variable
_I tried to use this function but didn't work_. Utterly useless statement. >> t = readtable('Uz.txt', 'ReadVariableName...

9 years ago | 1

Answered
Using Bonfire to analyse an image but Matlab gives an error message, any idea how this can be fix? Please help! Thanks.
No idea what _bonfire_ is in the context of matlab. It's not something that comes with it so if it's a third party package you'd...

9 years ago | 0

Answered
Can I assign values to an array in a diagonal direction from a reference point on that array?
Another option, with no issues near the edges. Requires the image processing toolbox: se = min(1, eye(5) + fliplr(eye(5)));...

9 years ago | 0

Answered
How can i find the both endpoints coordinates for a particular label number ?
See the |'BoundingBox'| property returned by <https://uk.mathworks.com/help/images/ref/regionprops.html |regionprops|> that you ...

9 years ago | 0

Answered
Finding specfic string within another string
if the aim is to obtain the name of the folder *after* the 'XX - ', then: folder = regexp(path, '(?<=\\[0-9]{2}\s-\s[^\\]+\...

9 years ago | 0

Answered
omitting objects dependent on their area in binary image
Using |BW2| as a variable name for the output of |regionprops| is extremely misleading. |BW2| implies a binary image *which is n...

9 years ago | 1

| accepted

Answered
How to join text in a table cell?
Your whole process of adding a new column and detecting your excess threshold is overly complicated. There is certainly never an...

9 years ago | 0

| accepted

Answered
Is that possible to index cell array with a string instead of a value? If not, suggest any that can do so?
No, it's not possible to index a cell array of matrix with a string/char array. You can use a <https://uk.mathworks.com/help/mat...

9 years ago | 2

Answered
What is the easiest way to get .csv-file from .mat-file, when I want to get modified rows?
No idea where the |'A1;11'| come from. As for the rest: %demo table t = cell2table({'x', 5, 0, 2; 'y', 1, 4, 3; 'z', 0, ...

9 years ago | 0

Answered
How can I isolate data from a matrix without a for loop?
arrayfun(@(si, ei) M(si:ei, :), pre_indices, post_indices, 'UniformOutput', false) This is most likely slower than the expl...

9 years ago | 0

Answered
How to make output single column in the same line as your calculation
_Any idea on why the code is giving the equivalent of a 6561x1 column vector for an input of 81x1 vector_ Typical case of a <...

9 years ago | 1

Answered
Using indexing for two arrays of different lengths
The first issue with what you're doing is with x == some_non_integer_value It will work for some values. For others, it...

9 years ago | 1

Answered
Conversion problem of data types of an array
I'm with |dpb|, fix the code so that it does not make a mess in the first place rather than trying to fix the mess. It sounds...

9 years ago | 0

| accepted

Answered
intersection of multiple arrays
This is in no way guaranteed to give you a perfectly balanced output. After that you need to look at optimisation algorithm whic...

9 years ago | 3

| accepted

Answered
function output getting 'index exceeds matrix dimension'
It is never a good idea to use common matlab function names as variable names. In the line matrix_max = max(row_max); Yo...

9 years ago | 1

| accepted

Answered
intersection of multiple arrays
This is how I'd do it: C = {[1 2 3 4], [1 4 5 6 7], [1 5 8 9 10 11]}; %sort cell array by increasing vector size: [~,...

9 years ago | 0

Answered
Finding columns in a cell array containing finite elements
cellfun(@(x) all(isfinite(x)), K) will return a logical array telling you whether each cell of |K| contains only finite val...

9 years ago | 1

| accepted

Answered
Permutation of only x elements of a vector
Doesn't your question just reduce to selecting 4 random integers from 1 to |numel(x)| using either |randperm| if the elements ha...

9 years ago | 0

| accepted

Load more