Respondida
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 = ...

más de 6 años hace | 0

| aceptada

Respondida
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 ...

más de 6 años hace | 0

| aceptada

Respondida
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...

más de 6 años hace | 0

Respondida
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]...

más de 6 años hace | 1

| aceptada

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

más de 6 años hace | 0

| aceptada

Respondida
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...

más de 6 años hace | 0

Respondida
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...

más de 6 años hace | 1

| aceptada

Respondida
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...

más de 6 años hace | 1

Respondida
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...

más de 6 años hace | 0

| aceptada

Respondida
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...

más de 6 años hace | 1

Respondida
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...

más de 6 años hace | 0

Respondida
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...

más de 6 años hace | 0

Respondida
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'

más de 6 años hace | 0

| aceptada

Respondida
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...

más de 6 años hace | 0

Respondida
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 ...

más de 6 años hace | 0

| aceptada

Respondida
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...

más de 6 años hace | 0

| aceptada

Respondida
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...

más de 6 años hace | 0

| aceptada

Respondida
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...

más de 6 años hace | 2

| aceptada

Respondida
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...

más de 6 años hace | 0

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

más de 6 años hace | 0

| aceptada

Respondida
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 ...

más de 6 años hace | 1

| aceptada

Respondida
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 ...

más de 6 años hace | 0

| aceptada

Respondida
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 ...

más de 6 años hace | 2

| aceptada

Respondida
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...

más de 6 años hace | 0

Respondida
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'...

más de 6 años hace | 0

| aceptada

Respondida
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...

más de 6 años hace | 0

Respondida
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...

más de 6 años hace | 0

| aceptada

Respondida
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...

más de 6 años hace | 0

| aceptada

Respondida
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.

más de 6 años hace | 1

| aceptada

Respondida
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 ...

más de 6 años hace | 2

Cargar más