Answered
eliminating NaN values from an array
newarray = originalarray(~isnan(originalarray))

10 years ago | 0

| accepted

Answered
why leading zeros are gets disappeared when i convert an character array to double matrix and can i convert the character array to binary matrix if yes then plz. suggest?
Because the numbers 001, 01, 1 are all the same (and so is 1 with an infinite numbers of leading 0), numbers are printed without...

10 years ago | 2

Answered
i have a binary image with an object now i want to calculate the distance in x-axis and y-axis how many pixel it covering ?
If what you want to get is the size of the object(s) bounding box, then simply use the |'BoundingBox'| property returned by <htt...

10 years ago | 0

Answered
Best unique maximum matching
This would work: [~, iRowPaired] = max(A, [], 1); %faster than sorting for v = unique(iRowPaired) %iterate over unique...

10 years ago | 0

Answered
Splitting a table file into many files based on delimiter
wholecontent = fileread('c:\pathtofile\filename.txt'); splitcontent = strsplit(wholecontent, '#'); %split content at each ...

10 years ago | 0

| accepted

Answered
How to integrate using a for loop?
Not withstanding the fact that the loop is completely unnecessary and the fact that the |sum| function would produce the same re...

10 years ago | 0

Answered
Changing Structure field value from a function
Matlab is pass-by-value. functions always receive the copy of the variable. Any change you make to variables are only local to t...

10 years ago | 0

Answered
How to remove MSB bit from a binary number?
b = imresize(imread('f.jpg'), [16 1]); d = arrayun(@(s) bitshift(b, -s), 1:8, 'UniformOutput', false); d{1} is all the v...

10 years ago | 0

Answered
Estimating pi using while loop for specific tolerence.
Please don't post picture of your code, we can't copy/paste it. There's a *{} Code* button to format pasted text as code. Rog...

10 years ago | 0

Answered
How can i read different data types (strings numbers vectors) from one .txt-File?
As per my comment you could use an xml file and <https://www.mathworks.com/help/matlab/ref/xmlread.html |xmlread|> or a json fil...

10 years ago | 2

| accepted

Answered
How to find even positioned numbers in a vector or matrix.
M(2:2:end, 2:2:end) will work for both vectors and matrices (and of course return empty for vectors). To extend to any ...

10 years ago | 1

Answered
Time matching across 2 differently sized time series arrays
As per KSSV's answer, the correct function for finding the values that are *exactly* identical in two vectors is <https://www.ma...

10 years ago | 0

| accepted

Answered
How do I change a whole row/column to zero in a matrix relating to a 'greater than' condition.
To set the rows/columns where the maximum sum is found: maxsum = max(U); %I'm assuming that U is a vector here A(U == m...

10 years ago | 0

| accepted

Answered
How to match the table
Have you tried <https://www.mathworks.com/help/matlab/ref/join.html |join|>? %in the future make it easy to use your exampl...

10 years ago | 0

| accepted

Answered
Finding the mean of all the rows in a field in a struct?
It sounds like a structure may not be the ideal type for storing your data. Why is it spread over three different fields if you ...

10 years ago | 0

Answered
A loop within a loop (for or if)
I don't particularly understand your question. All I know is you don't need a loop to generate your final |a|. I assume your ...

10 years ago | 0

Answered
help need im my code
Of course it's not running vg= (0 -1 -2 -3 -4 -5 ) is not valid syntax. Perhaps you meant: vg = [0 -1 -2 -3 -4 -5] ...

10 years ago | 0

Answered
Inserting data into MySQL Server Table
Well, the error message is fairly clear, you're trying to insert data (in your case, strings) in a column that is bigger than th...

10 years ago | 2

Answered
How to sum a specific range of values in a column?
A few notes first. 1) Avoid |length|, it's a dangerous function. Use |numel| or |size| with an explicit dimension. 2) There's no...

10 years ago | 0

| accepted

Answered
how to do the following?
This is really not complicated. So far you've only implemented one half of any statement. Maybe spend more time understanding th...

10 years ago | 1

| accepted

Answered
get all the handles value from a form
Note: There are no forms in matlab, only figures. Probably the simplest to get the controls of the figure is to retrieve the ...

10 years ago | 0

Answered
Help to avoid the eval() function
feval(function_name, varargin{:}) Will call the function with however many arguments are stored in |varargin|.

10 years ago | 0

Answered
Retrieving data from a structure
K4_COM = vertcat(Dat_store_12.K4_com) is the correct syntax (yours was equivalent to |horzcat(Dat_store_12.K4_com)| hence w...

10 years ago | 0

| accepted

Answered
How can I place a cell array in another cell array using 'find'?
If I understood correctly: Ax = randi([0 1], 4, 960); %Demo data. No way I'm reformating your example to make it valid mat...

10 years ago | 0

| accepted

Answered
Adapting a dataset such that it contains unique values
Possibly, A = [repmat(225,6,1); repmat(240,13, 1); repmat(255,3, 1)] startidentical = find(diff([-Inf; A; Inf])); %locat...

10 years ago | 0

| accepted

Answered
Find missing days in a date vector matlab
If I understood correctly this would work: origdata = load('Temp1975.mat'); origdata = table(origdata.Jour', origdata.St...

10 years ago | 0

| accepted

Answered
How to find values which are in specific range for each rows in matrix...?
The loop is completely pointless in this case. Plus, once you've fixed the error with |&&|, if there's more than one value that ...

10 years ago | 1

| accepted

Answered
How do I calculate the RMS of every 5 values?
If you mean you want the RMS of the first 5 values, followed by the RMS of the next 5 values, etc., then assuming your vector le...

10 years ago | 8

| accepted

Answered
how to display the values of an array within the specific bin ranges (index positions)?
One possible solution: y = zeros(size(x)); indices = cell2mat(arrayfun(@(istart, iend) istart:iend, idx1, idx2, 'Uniform...

10 years ago | 0

Answered
How to add new lines after some specific characters for a big string (1M)?
You tagged your question with |regexp|. Unfortunately, it's not going to be possible with a regular expression. You're going to ...

10 years ago | 0

Load more