Answered
How to speed up my code containing several for loops
You can easily vectorise part of the inner sum computation: %precompute before any loop: [i, iprime] = ndgrid(1:L); PNprod = ...

6 years ago | 0

| accepted

Answered
How to allow a single overlap during chain growth?
%this code only works if rows of Trajectory are unique [intraj, where] = ismember(check, Trajectory, 'rows'); %find which row ...

6 years ago | 0

| accepted

Answered
How to detect blue spot in an image
You're using a very crude way of detecting colour (working in RGB is not a good idea for colour detection) and the quality of yo...

6 years ago | 0

Answered
Add date stamp to time stamp
Here's how I'd do it. Whatever you do don't use outdated datenum and datestr. Stay with datetime and duration arrays. [h, m, s]...

6 years ago | 1

| accepted

Answered
How do I take the mean of each row every third column?
mean(yourarray(:, 1:3:end), 2)

6 years ago | 0

| accepted

Answered
How to add a matrix data to cell array?
Probably the best answer is don't use a cell array, use a table which is designed exactly for the purpose of having named column...

6 years ago | 0

Answered
hourly data to daily- when time steps start at 00:00 and end on 23:00 each day (how to consider another 1 hour between 23:00 to 23:59 which presents on the next day)
Nothing is attached. Anyway, the simplest way to do what you want is to store your data in a timetable. Then you simply retime t...

6 years ago | 1

| accepted

Answered
Possible to modify only one portion of an array in one line?
x(transition:end) = min(x(transition:end), xMax) will be more efficient (than the now accepted answer) since it only test the c...

6 years ago | 1

Answered
Reading multiple excel files with data store when the columns of the files change position
This works with the very simple test case I built (of two excel files with columns in different order and the 2nd file with extr...

6 years ago | 0

| accepted

Answered
How can I verify my university login information
For license issues your best bet is to contact mathworks support directly. See contact us link at the top of the page (the telep...

6 years ago | 1

Answered
How to use fillmissing with table variables of type cell
Well, you're a funny one! You've asked a very similar question. You were given two answers, one of which used fillmissing to d...

6 years ago | 0

Answered
How do I fix this! I just started to learn about it
If you are starting to learn matlab, then I would strongly recommend you learn to create GUIs using App designer instead of GUID...

6 years ago | 0

Answered
How do i convert a numerical cell array in a vector ?
A safer alternative to str2num would be: sscanf(Arr{1}, '%d,') %assuming all the numbers are integers, otherwise '%f'

6 years ago | 0

| accepted

Answered
How to replace a string with another string in specific table columns
One easy way: missinglocs = ismissing(t, '[]'); newt = fillmissing(t, 'constant', '-99', 'DataVariables', startsWith(t.Proper...

6 years ago | 0

Answered
How to add new row to matrix of variable columns
You can't add variable names to matrices. Matrices can only contain numbers. However, you could use a table which are designed ...

6 years ago | 0

| accepted

Answered
How to apply arrayfun for multiple column
If you really want to use arrayfun you could do it like this: windowsize = 100; %why call it m when window size is a lot clear...

6 years ago | 0

| accepted

Answered
Method Input within Function (or something like that)
What this error is telling you: Not enough input arguments. Error in myfunction (line 19) element = update(element,Su...

6 years ago | 0

| accepted

Answered
How to write a LOOP for this case?
So again, numbered variables and field names are a bad idea. (see here and here) for the related questions). The whole thing wou...

6 years ago | 2

| accepted

Answered
How to summarize this code?
As demonstrated by the later questions (here and here), this was a very bad idea in the first place. Creating numbered or sequen...

6 years ago | 0

Answered
Making Matrix Dimensions Equal
smallestwidth = min(cellfun('size', yourcellarray, 2)); %smallest width of all matrices in the cell array newcellarray = cellf...

6 years ago | 0

| accepted

Answered
How to write a Loop for this case?
Creating these numbered fields was a bad idea in the first place.Numbered or sequentially named variables or fields always make ...

6 years ago | 1

| accepted

Answered
how to split a file
Your file has a bit of an odd format, in particular some lines have an extra *** at the end. It's not clear if it's significant ...

6 years ago | 0

| accepted

Answered
Can I get full matlab on an android tablet if I can install linux on it?
You can see the system requirements for matlab here (may require you to be logged in). For 2019b, the list of supported linux ...

6 years ago | 2

| accepted

Answered
how should i go about storing the rgb values for this problem
Actually, the hint that you are likely to need double and uint8 is very much outdated. Support for integer types was added in R2...

6 years ago | 0

Answered
unexpected comma in regexp output
Note your example input is not valid matlab syntax. I assume the internal ' are meant to be doubled. I'm not too sure what you'...

6 years ago | 0

| accepted

Answered
Understanding :error To RESHAPE the number of elements must not change while manipulating matrix
It's very unclear what your code is meant to do, it makes no sense. Anyway, in your loop your creating (sometimes!) L as a vect...

6 years ago | 0

Answered
finding intersections between circle and gear teeth
Get the pixels on the boundary with bwboundaries or bwtraceboundary. Calculate their distance to the centre of your circle. Then...

6 years ago | 0

| accepted

Answered
Skipping first few lines while loading text file
That file is a mess. It looks like the number of spaces around the numbers is significant, which is never a good idea. Thankfu...

6 years ago | 0

| accepted

Answered
Inline function is not working properly
is exp(x) in matlab. There is no need for inline: f = @(n) exp(-n/5) .* cos(pi*n/5) .* (n>=0); assuming is n>=0.

6 years ago | 1

| accepted

Answered
How can I convert time from seconds to decimal year in Matlab?
First convert your numbers to datetime. Trivially done: d = [416554767.293262 416554768.037637 416554768.782013 ...

6 years ago | 2

Load more