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

mehr als 6 Jahre vor | 0

| akzeptiert

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

mehr als 6 Jahre vor | 0

| akzeptiert

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

mehr als 6 Jahre vor | 0

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

mehr als 6 Jahre vor | 1

| akzeptiert

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

mehr als 6 Jahre vor | 0

| akzeptiert

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

mehr als 6 Jahre vor | 0

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

mehr als 6 Jahre vor | 1

| akzeptiert

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

mehr als 6 Jahre vor | 1

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

mehr als 6 Jahre vor | 0

| akzeptiert

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

mehr als 6 Jahre vor | 1

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

mehr als 6 Jahre vor | 0

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

mehr als 6 Jahre vor | 0

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

mehr als 6 Jahre vor | 0

| akzeptiert

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

mehr als 6 Jahre vor | 0

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

mehr als 6 Jahre vor | 0

| akzeptiert

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

mehr als 6 Jahre vor | 0

| akzeptiert

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

mehr als 6 Jahre vor | 0

| akzeptiert

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

mehr als 6 Jahre vor | 2

| akzeptiert

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

mehr als 6 Jahre vor | 0

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

mehr als 6 Jahre vor | 0

| akzeptiert

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

mehr als 6 Jahre vor | 1

| akzeptiert

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

mehr als 6 Jahre vor | 0

| akzeptiert

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

mehr als 6 Jahre vor | 2

| akzeptiert

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

mehr als 6 Jahre vor | 0

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

mehr als 6 Jahre vor | 0

| akzeptiert

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

mehr als 6 Jahre vor | 0

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

mehr als 6 Jahre vor | 0

| akzeptiert

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

mehr als 6 Jahre vor | 0

| akzeptiert

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

mehr als 6 Jahre vor | 1

| akzeptiert

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

mehr als 6 Jahre vor | 2

Mehr laden