Réponse apportée
Is it possible to have matlab go into debugging mode only when it hits a nan?
dbstop IF NANINF

environ 8 ans il y a | 0

Réponse apportée
A breakpoint immediately after the execution of the code
Either add a breakpoint to the next line, or add a line that does nothing (like |1+1;|) and add a breakpoint to that.

environ 8 ans il y a | 0

Réponse apportée
How can I disable the code folding in the editor?
Go to preferences, under Matlab->Editor/Debugger->Code Folding There you can enable/disable all code folding, and set what co...

environ 8 ans il y a | 2

| A accepté

Réponse apportée
Effective way to convert/create matrix from mixed cell/string
array ={ [47.4500] '' [23.9530] '' [12.4590] [34.1540] '' [15.1730] '' [ 9.6840] ...

environ 8 ans il y a | 0

| A accepté

Réponse apportée
How to erode images in MATLAB without <imerode>?
If you are allowed to use the |convn| function, you can use the code below. You need the comparator, because around the edges th...

environ 8 ans il y a | 0

Réponse apportée
How to save all workspace variables and figures in a folder?
You can save all variables in the current workspace by using |save| without specifying any variable name, although this is inadv...

plus de 8 ans il y a | 1

| A accepté

Réponse apportée
How do I link my key.m nargin function (with switch statements) in my main.m script?
Just put the following line in your main.m file [cm, percentage] = key(T1,T2,T3); As long as key.m is on your Matlab pat...

plus de 8 ans il y a | 0

Réponse apportée
separating an image into two images
Convert the image to a grayscale (e.g. with |im2double|), invert (just do |IM=1-IM;|), and find the columns that sum to 0. Then ...

plus de 8 ans il y a | 0

Réponse apportée
How to get the opposite elements of a vector specified by an index?
|randsample| picks values from 1 to N, not 0 to N. The first block is for 1:N, the second for 0:N maxval=100; s = randsa...

plus de 8 ans il y a | 0

| A accepté

Réponse apportée
Why is my variable undefined?
Not all options for your if-structure will result in defining |g| if age<1 a=.4; else if (age>=1) && (age<...

plus de 8 ans il y a | 1

Réponse apportée
How to rotate a matrix?
You need to apply a conversion to the values inside the matrix, not the matrix itself. Using |meshgrid| is indeed helpful for ge...

plus de 8 ans il y a | 0

| A accepté

Réponse apportée
¿How to reproduce sound from one button (and let it loop) until press stop with other button?
Set a flag to true in your start function and play the sound in a loop. Check that flag every iteration of your loop. Your stop ...

plus de 8 ans il y a | 1

| A accepté

Réponse apportée
Help writing a for/while loop to identify and sort prime numbers
You already have a list of all the primes, so you don't need |isprime| anymore. What you now want to do is figure out the distan...

plus de 8 ans il y a | 2

Réponse apportée
Simple question about if statement
You should use logical indexing, like in the example below, or use a loop. LogicalIndexing=allorient(:,1)==1; allorient(...

plus de 8 ans il y a | 0

| A accepté

Réponse apportée
'Assignment has more non-singleton rhs dimensions than non-singleton subscripts'. Can you guys help me fixing this error?
The output of |sum| is a vector, as the input is a 2D matrix. To calculate the sum over all rows and cols, you can use the code ...

plus de 8 ans il y a | 0

| A accepté

Réponse apportée
Does the student edition of MATLAB have any limitations regarding the exporting of 3D graphs of surfaces to .stl files for 3D printing?
The stl file format is not owned by Mathworks. You can just write to it. There is even a <https://www.mathworks.com/matlabcentra...

plus de 8 ans il y a | 0

| A accepté

Réponse apportée
Workspace variables in R2015a
What dpd says is not entirely true. Some releases have a bug in displaying the min and max in the workspace window, but all at l...

plus de 8 ans il y a | 0

| A accepté

Réponse apportée
I have 98x3 matrix with only 7 unique rows of values which are output of some simulation. How do I extract that? I tried Unique function but am not getting unique rows. Below is the original matrix A and matrix after using unique function B.
This is probably due to rounding errors caused by the way |doubles| are stored in computers. You can use <https://www.mathworks....

plus de 8 ans il y a | 0

| A accepté

Réponse apportée
How do I plot many rows from many matrices made in a loop?
Your function looks like you could use |meshgrid| to generate the matrices that you need. ns=[1.5:0.01:1.6]'; B=ns./1.33...

plus de 8 ans il y a | 0

Réponse apportée
Expand a figure by clicking on the subplot, a opening a new figure.
If I recall correctly, there is a click callback property for |axes| objects, but I can't find it. You can always replicate this...

plus de 8 ans il y a | 1

Réponse apportée
how to insert "Filled Triangle" as text box in a Matlab figure?
You need the |amssymb| package to render this symbol. With some digging you should be able to add this package to your Matlab co...

plus de 8 ans il y a | 0

Réponse apportée
Math operations on array of objects
If each |A.b| contains one value, you could use <https://www.mathworks.com/help/releases/R2018a/matlab/ref/arrayfun.html |arrayf...

plus de 8 ans il y a | 0

| A accepté

Réponse apportée
How to save the textfiles in another paste?
Without actually having delved through your code, you could try the modification below. movefile(TXT_filefolders{ii}, 'C:\U...

plus de 8 ans il y a | 0

| A accepté

Réponse apportée
slope of a line when intercept is forced to zero
x = [1 2 3 4 5 6]; y = [11 61 111 161 211 261]; m=x(:)\y(:); You can find the doc if you look for <https://www.mathworks...

plus de 8 ans il y a | 0

| A accepté

Réponse apportée
Using push button to run function based on checkboxes
Move the code to the callback for your button and include an if-statement around that code that queries the state (the |Value| p...

plus de 8 ans il y a | 0

Réponse apportée
How do I place two columns side by side in the same column?
A = [1;2;3]; B = [4;5;6]; C = A.*10.^floor(log10(A)+1)+B;

plus de 8 ans il y a | 0

Réponse apportée
New values not saving in the matrix after each iteration
You are overwriting the result every iteration, instead of adding it to an existing vector. You could dynamically grow these vec...

plus de 8 ans il y a | 1

| A accepté

Réponse apportée
Given list of points in 3D, find the point that the euclidian sum of the distance is minimal
To extend your |f| function I have the following suggestions. The upper one mirrors your method, the second doesn't really. I do...

plus de 8 ans il y a | 0

| A accepté

Réponse apportée
create a matrix with the same entry
Something like this maybe? y=x*ones(NRows,1);

plus de 8 ans il y a | 0

| A accepté

Réponse apportée
How do I change a grid size?
The simplest way to do this is with <https://www.mathworks.com/help/releases/R2018a/matlab/ref/meshgrid.html |meshgrid|>.

plus de 8 ans il y a | 0

Charger plus