Answered
How can I generalise this?
As per my comment to your question: numbered variables are always an indication that your design is wrong. You should never have...

8 years ago | 1

| accepted

Answered
How to create table with existing arrays?
I don't understand the difficulty you're facing. What's wrong with just using <https://www.mathworks.com/help/matlab/ref/table.h...

8 years ago | 0

Answered
cell2table only using first cell array row
_Why aren't I getting all 4 rows in my table?_ Matlab does exactly what you asked. As you've shown |E| is a 4 (rows) x 1 (col...

8 years ago | 0

Answered
Randomize / Shuffle function with order (no subsequent repetition) constraint
Your requirements seem fairly simple. The only difficult one is the requirement that there be no more than two identical consecu...

8 years ago | 0

| accepted

Answered
Counting the number of 'gaps' in a binary image?
sum(diff(yourimage, [], 2) > 0, 2) - 1 Will give you the number of transition from 0 to 1 (or 255) minus 1, per row. Note ...

8 years ago | 1

| accepted

Answered
Write a convertCM() function that converts the given vector into the nearest whole number of feet and inches and returns it as two vectors named FEET and INCHES.
_each time i run it .. it keeps telling me: Not enough input arguments._ I recommend you read the help on <https://www.mathwo...

8 years ago | 0

| accepted

Answered
How to remove an element from a structure array using matfile handler
As <https://www.mathworks.com/help/matlab/ref/matfile.html#bt2ft8s-6 documented in the limitations> of |matfile|, it does not le...

8 years ago | 0

Answered
Use row vector index values to select a matrix portion. Error: Index exceeds matrix dimensions.
Nearly every single line of code is a potential problem. threshold=ones(1:ncol); Hopefully this is a typo in your questi...

8 years ago | 0

Answered
Abnormal results using + operator in matlab 2018a
_"Can any anyone explain whats happening"_ That is the behaviour of matlab since R2016b introduced <https://www.mathworks.com...

8 years ago | 0

| accepted

Answered
Want to get all outputs together as one in image processing
Use <https://www.mathworks.com/help/matlab/ref/subplot.html |subplot|> img = imread('cameraman.tif'); figure; subplo...

8 years ago | 0

Answered
how to create pairwise label matrix ?
Going with dpb's example (with slightly better variable names, don't use |class| it's too useful a function to shadow!), to gene...

8 years ago | 1

Answered
How to Move Multiple ROI's at the same time?
What you want is not really supported by |impoly|. You could sort of fake it by merging the two polygon positions separated with...

8 years ago | 1

| accepted

Answered
warndlg SQL statement for iscellstr
In your |if... else| statement, if the |if| branch is not taken, then no warning dialog is created. Thus it's puzzling why you'd...

8 years ago | 0

Answered
import multiple csv files in matlab
A simpler version of your code, that will produce a 3D array instead of stacking the images horizontally: folder = ''/Users...

8 years ago | 0

| accepted

Answered
How to Split hexadecimal in to separate bytes?
You haven't shown us the class of |HexVal|. From the error you get with Paolo's answer I suspect that |HexVal| is an Nx4 char ar...

8 years ago | 1

| accepted

Answered
How to replace a certain part of file name
Loading the images and saving them back again just to change a filename is a big waste of time. Just <https://www.mathworks.com/...

8 years ago | 0

Answered
runs of 1s and 2s in a long vector
If you want to find the number of runs (regardless of their length) as opposed to the count of 1s or 2s: v = [0 3 1 1 1 4 5...

8 years ago | 0

| accepted

Answered
how to read binary data from text file ? is there a way to convert this read data in signed integer?
There are two lines with 'xxxx', what do you want to do with them? The last line does not have 32 bits, how is that to be int...

8 years ago | 2

| accepted

Answered
How remove a field inside a structure?
I haven't downloaded your mat file to check but this will probably do what you want: sd.Variables = structfun(@(var) rmfiel...

8 years ago | 0

Answered
Cell array strings storage
_you have to do array2{1}{1} to get that same 'a'_ Yes, of course, because in the second case, you have a cell array of cell ...

8 years ago | 1

| accepted

Answered
MATLAB MOBILE (interrupted. operation taking longer than 240 seconds are not supported with Matlab Mobile)
It means exactly what is says, if an operation takes longer than 4 minutes to complete, matlab movile aborts it and you don't ge...

8 years ago | 0

| accepted

Answered
hi i want to calculate nth power for each value of s from 1 to 50 and store the result for each value of s in za varaible
Sounds like homework to me. Do you have to use a loop? The normal matlab way is simply: za = (1:50).^2; If you do hav...

8 years ago | 0

Answered
How can I map to each vector entry a number telling its occurence so far?
It can be done without a loop, however for part of the code I recommend you use <https://www.mathworks.com/matlabcentral/fileexc...

8 years ago | 1

Answered
How to use values in each respective row(different columns) in excel?A calculation that goes row by row and the result of each row stored
Issues I see with your code: 1) if E_PV(n) > L(n) %removed pointless brackets ... else ...

8 years ago | 0

Answered
How can I access multiples areas in one array without using a for-loop?
This probably does what you want: %A a vector signchange = [0; diff(sign(A))]; %find sign changes in A transitions ...

8 years ago | 0

| accepted

Answered
Combine Tables with different record rate
_How can I create an additional column within the table which contains all the information of those three others and makes a tim...

8 years ago | 0

| accepted

Answered
How can I access multiples areas in one array without using a for-loop?
With arrays that size, the fastest is probably the loop you have written. With smaller arrays, you could do: indices = ...

8 years ago | 0

Answered
Index exceeds matrix dimensions
There are many problems with your code. The line t=.02,1 is equivalent to t = 0.02 1 I have no idea what you ...

8 years ago | 0

Answered
Can anybody help me to solve the error from this code function it will be a nice help
If _"the error from this code function"_ is caused by |imread|, that would be because |imread| does not accept string inputs, on...

8 years ago | 0

Answered
Look Up table Random breakpoints
_the last value i.e. at last point among the three, so at breakpoint 4 in case of value 3_ Then simply remove all duplicate b...

8 years ago | 0

Load more