Risposto
Can a string be converted into a function call inside a GUI?
While you could do it like this, I personally replace the contents of the file itself on update and ask the user to restart the ...

circa 7 anni fa | 0

| accettato

Risposto
How to create a for/ while loop until a condition is met
You can use the min function to enforce a maximum outcome. max_cost_allowed=14; cost=min(cost,max_cost_allowed); As a more ge...

circa 7 anni fa | 0

| accettato

Risposto
MEAN OF IMAGE IN MATLAB
If your list of images is a 0x1 struct, then the files are not found. Once you solve that issue, you can use the code below to f...

circa 7 anni fa | 1

Risposto
how to generate a vector of zeros with 2 random successives cell containing ones
If you don't mean cell, but element: n=10;%vector length v=zeros(1,n); one_ind=randi(n-1,1); v(one_ind+[0 1])=1; If you do ...

circa 7 anni fa | 1

Risposto
Creating Table From Excel Data
A dot can mean two things: accessing a field of a struct or a variable in a table calling a method in a class, e.g. in the syn...

circa 7 anni fa | 0

Risposto
How do I get rid of this error. Error using monte_carlo_error (line 42) 'normrnd' requires Statistics and Machine Learning Toolbox."
The Statistics and Machine Learning Toolbox is included in the student suite (which is a product you can buy with a student lice...

circa 7 anni fa | 1

Risposto
normally distributed demand data
You can use the randn function to generate random numbers. n=300;%number of cases minval=0;%lowest allowed integer maxval=100...

circa 7 anni fa | 0

| accettato

Risposto
calculating Kernel density for each column
I am assuming the v values are the same as the column index, and that you made a mistake with the code for the second column. Z...

circa 7 anni fa | 0

| accettato

Risposto
Difference Between ValueChangedFcn & ValueChangingFcn
If you read the documentation carefully, you will notice a subtle difference. This difference is more easily explained with a ui...

circa 7 anni fa | 9

| accettato

Risposto
How to pass image from one push button to another ?
Save it to the guidata struct.

circa 7 anni fa | 0

| accettato

Risposto
can I run the matlab code file made in old days in recent version of matlab
Some function have been removed, some syntaxes have changed. Most of Matlab is backwards compatible, but not 100% is. The more c...

circa 7 anni fa | 0

Risposto
Share data between gui
Pass a handle to the second gui when calling gui 3 and 5. Then you can use guidata to load the data from gui2 in gui5.

circa 7 anni fa | 0

Risposto
While conditioning to any element of an array
You need to make sure you have a scalar condition, instead of having an array. The any and all functions are very useful in case...

circa 7 anni fa | 0

| accettato

Risposto
i need to convert a folder of 200 .jpg images to .mat (to create 200 separate .mat files). i know there should be an easy matlab for loop to do this but I need help (newbie). thanks!
You're quite close. You were only missing the way to generate char arrays from a pattern. To do that you can use the sprintf fun...

circa 7 anni fa | 1

Risposto
import XLSX FILE and plot it in guide
Now I realize what was the strange thing about your code: they are char arrays instead of function handles. In principle that is...

circa 7 anni fa | 0

Risposto
Rebuild the matrix according to the values of its elements
Edit: Now I think I get it. That is also where your precision remark is coming from. The code below gets the job done with isme...

circa 7 anni fa | 0

Risposto
For loop count question
Initialize count to 0 before your nested loop and do count=count+1; inside the inner loop.

circa 7 anni fa | 0

Risposto
How do I write a Roulette Code?
n_games=100; your_number_pick=34; Red=[1:2:9 12:2:18 19:2:27 30:2:36]; Black=[2:2:10 11:2:17 20:2:28 29:2:35]; roulette_...

circa 7 anni fa | 1

Risposto
"at most" in MATLAB
This code should help: check =[1 4;2 5;3 6]; %i=2;j=3; i=5;j=3; matches_per_col=sum(check==i | check==j,1); if max(matches_...

circa 7 anni fa | 1

| accettato

Risposto
how to delete the previous plot obtained using slider in GUIDE
The easiest way to accomplish this is to create the second plot first, using the same positions as the first plot (which will th...

circa 7 anni fa | 0

Risposto
How can i make my code interactive?
You aren't checking if the values are valid. That means you're never changing the value of valid, which results in an endless lo...

circa 7 anni fa | 0

| accettato

Risposto
How do I separate a string with hyphen and colon separation within cell
If you know the pattern you can simply use that to edit the FormatSpec: fileID=fopen('RD-180531-160600.txt'); FormatSpec='%4s-...

circa 7 anni fa | 0

| accettato

Risposto
Justify text in MATLAB Live Editor
Yes, the buttons to allign text are in the lint:

circa 7 anni fa | 0

Risposto
iam getting error while iam debugging the code in matlab 2019, But it is excuting in matlab 2014 version.... Iwant this in MATLAB 2019 please help me
There are only two relevant lines from your enormous blocks of code (that you didn't format yourself): %initial post: h_16qam=...

circa 7 anni fa | 0

| accettato

Risposto
Replace matched values with a cell array keeping unmatched values unchanged
This code should help A = '[0, 40, 50, 60, 80, 100, 140, 160, 200, 300]'; B = '48 43 533 6320 ...

circa 7 anni fa | 1

| accettato

Risposto
How to campare index number of a matrix with other
A=[ 9 8 5 4 4 10]; B=[1 1 1 3 3 3 2 2 1 1]; newA=B(A);

circa 7 anni fa | 1

Risposto
How can I multiply axis values by 1000 without changing the data?
You can either multiply the y-values with 1000, or use the YTickLabels: ticks=get(gca,'YTicks');%retrieve current ticks ticks=...

circa 7 anni fa | 3

Risposto
regexp for time - cannot guess it
If you know this format, maybe a regexp isn't the right tool for the job. function s=parse_time(str) c=regexp(str,'\.','split'...

circa 7 anni fa | 0

Risposto
read empty line by textscan
If your file doesn't contain any special characters, you could try fileread (which reads a file as one long char array), then sp...

circa 7 anni fa | 2

| accettato

Risposto
Subtraction of 2 matrices of the same dimensions and values, gives large floating point values instead of 0!
Welcome to the world of floating point calculation. Computers store values in binary, which sometimes requires rounding. This ro...

circa 7 anni fa | 1

| accettato

Carica altro