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

más de 7 años hace | 0

| aceptada

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

más de 7 años hace | 0

| aceptada

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

más de 7 años hace | 1

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

más de 7 años hace | 1

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

más de 7 años hace | 0

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

más de 7 años hace | 1

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

más de 7 años hace | 0

| aceptada

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

más de 7 años hace | 0

| aceptada

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

más de 7 años hace | 9

| aceptada

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

más de 7 años hace | 0

| aceptada

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

más de 7 años hace | 0

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

más de 7 años hace | 0

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

más de 7 años hace | 0

| aceptada

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

más de 7 años hace | 1

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

más de 7 años hace | 0

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

más de 7 años hace | 0

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

más de 7 años hace | 0

Respondida
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_...

más de 7 años hace | 1

Respondida
"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_...

más de 7 años hace | 1

| aceptada

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

más de 7 años hace | 0

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

más de 7 años hace | 0

| aceptada

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

más de 7 años hace | 0

| aceptada

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

más de 7 años hace | 0

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

más de 7 años hace | 0

| aceptada

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

más de 7 años hace | 1

| aceptada

Respondida
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);

más de 7 años hace | 1

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

más de 7 años hace | 3

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

más de 7 años hace | 0

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

más de 7 años hace | 2

| aceptada

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

más de 7 años hace | 1

| aceptada

Cargar más