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

circa 8 anni fa | 0

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

circa 8 anni fa | 2

| accettato

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

circa 8 anni fa | 0

| accettato

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

circa 8 anni fa | 0

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

circa 8 anni fa | 1

| accettato

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

circa 8 anni fa | 0

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

circa 8 anni fa | 0

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

circa 8 anni fa | 0

| accettato

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

circa 8 anni fa | 1

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

circa 8 anni fa | 0

| accettato

Risposto
¿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 ...

circa 8 anni fa | 1

| accettato

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

circa 8 anni fa | 2

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

circa 8 anni fa | 0

| accettato

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

circa 8 anni fa | 0

| accettato

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

circa 8 anni fa | 0

| accettato

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

circa 8 anni fa | 0

| accettato

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

circa 8 anni fa | 0

| accettato

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

circa 8 anni fa | 0

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

circa 8 anni fa | 1

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

circa 8 anni fa | 0

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

circa 8 anni fa | 0

| accettato

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

circa 8 anni fa | 0

| accettato

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

circa 8 anni fa | 0

| accettato

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

circa 8 anni fa | 0

Risposto
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;

circa 8 anni fa | 0

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

circa 8 anni fa | 1

| accettato

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

circa 8 anni fa | 0

| accettato

Risposto
create a matrix with the same entry
Something like this maybe? y=x*ones(NRows,1);

circa 8 anni fa | 0

| accettato

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

circa 8 anni fa | 0

Carica altro