Réponse apportée
How to find the index of the first and last non-zero value of a vector ?
The built in command find sounds like what you need. The code could look something like f = ...0,0,0,0,0,0,0,0,5,6,7,4,3,5,6,7,...

presque 4 ans il y a | 0

| A accepté

Réponse apportée
Unrecognized function or variable
Sya is defined in the code body, but not in the function. Read up on the scope of a Matlab variable for more information. To fi...

presque 4 ans il y a | 0

| A accepté

Réponse apportée
When i try this sym('x')^y i get an error message
I haven't used the symbolic toolbox before, but when I type 18008617784390347685963^60322355516214665580 into my Matlab commandl...

presque 4 ans il y a | 0

Question


How do I iterate over vector elements, but ignore elements which do not meet a condition?
I have a piece of code, which I'm trying to make run faster. I've used the profiler and most of the time is spent on the followi...

presque 4 ans il y a | 3 réponses | 0

3

réponses

Réponse apportée
1x4 times 4x4 matrix in Matlab
Use the rules for matrix multiplication to help you. What solved one persons problem won't always solve yours. A 4x4 multiplied...

presque 4 ans il y a | 0

Réponse apportée
How to fix a matrix error
A (and consequently, L, D and U) is a 16x16 matrix. b is a 1x17 matrix. To fix this, either make A one bigger in each dimension,...

presque 4 ans il y a | 0

| A accepté

Réponse apportée
I have successfully detected skin color but not able to understand the working of find function in it.
It's tricky to say when we can't run the code, but I'll give it my best shot. It seems like the code imports an image. The imag...

presque 4 ans il y a | 0

Réponse apportée
Matlab doesn;t recognise a variable when I run the program
Your if statements aren't working because you're comparing a vector (x) to a scalar 0, L/2 or L. Instead what I think you're try...

presque 4 ans il y a | 0

| A accepté

Réponse apportée
Error bars are automatically offset. they look correct just the error bar for any point should be located at the point before it
The scatter plot is plot(t, d40avg). The Error bar plot is plot(d40avg, d40std). At first glance it may look like the erro...

presque 4 ans il y a | 0

| A accepté

Réponse apportée
Keep on getting 'Error using plot, Vectors must be the same length'. How can I plot it correctly?
When the while loop breaks, you have defined T to have length of i_max, and t has length i_max+1. This is because of the line ...

presque 4 ans il y a | 0

| A accepté

Question


What determines the increase in speed for parfor vs. for?
The question is simply that. I know that for some loops with a lot of overhead, it can be slower. In some cases, it can be faste...

presque 4 ans il y a | 1 réponse | 0

0

réponse

Question


How do I efficiently iterate over subvectors of a given vector?
I have a vector of length N, which I want to generate all possible subvectors of of length n and sum over the subvectors. At the...

presque 4 ans il y a | 1 réponse | 0

1

réponse

Réponse apportée
Function that should be continuous isn't continuously plotted?
At the origin, x and y are both zero, so the denominator of your function is undefined. For me it's returning NaN at the central...

presque 4 ans il y a | 1

Réponse apportée
How do I call a function which I have defined within a class?
This question has now been answered on Stack Overflow: https://stackoverflow.com/questions/65038867/matlab-how-do-i-call-a-fu...

presque 4 ans il y a | 0

| A accepté

Question


How do I call a function which I have defined within a class?
I'm trying to learn how to use classes in Matlab, having never used them in any language before, so apologies if this is a bit b...

presque 4 ans il y a | 2 réponses | 0

2

réponses

Réponse apportée
How to plot hyperbola curve to pints?
You need more values in your vector x. Try it with x0 = linspace(0.002, 0.2, 100); and alter your code to be hyprb = @(b,x)...

presque 4 ans il y a | 0

| A accepté