Answered

Using a while loop with a vector

Your while loop actually only runs once because after the first iteration, B>360 returns a logical array of [0 0 0 1 1 1], so it...

Using a while loop with a vector

Your while loop actually only runs once because after the first iteration, B>360 returns a logical array of [0 0 0 1 1 1], so it...

mer än 2 år ago | 0

| accepted

Question

How would these functions behave after compiling from GUI -> Executable?

I have designed a matlab gui (not with guide or appdesigner) and am interested in eventually compiling it into an executable fil...

mer än 2 år ago | 0 answers | 0

Answered

animate for a given time

tic toc is used to see how long processes take in your script. This is not relevant to what you are trying to do. You should ta...

animate for a given time

tic toc is used to see how long processes take in your script. This is not relevant to what you are trying to do. You should ta...

mer än 2 år ago | 0

Answered

index in matrix using loop

m = [0.5 0.5; 0.25 0.5; -0.5 -0.5] % your sample matrix f = m(m>0) * A + fill c = m(m<0) *A + cut ^ this only return the va...

index in matrix using loop

m = [0.5 0.5; 0.25 0.5; -0.5 -0.5] % your sample matrix f = m(m>0) * A + fill c = m(m<0) *A + cut ^ this only return the va...

mer än 2 år ago | 0

Answered

I am having problems in anonymous function (y=@(x)(...))

let me know if this is what youre trying to do with your anon functions: function y = fun(a,x) y = sum(triu(repmat(flip(x.^(1...

I am having problems in anonymous function (y=@(x)(...))

let me know if this is what youre trying to do with your anon functions: function y = fun(a,x) y = sum(triu(repmat(flip(x.^(1...

mer än 2 år ago | 0

Answered

Plot is not working

Your T is a vector, and your Y is a scalar. There is no singular line because it is actually plotting all 5 points as individual...

Plot is not working

Your T is a vector, and your Y is a scalar. There is no singular line because it is actually plotting all 5 points as individual...

nästan 3 år ago | 0

| accepted

Answered

why nothing is happening when i am calling other function in other button?

what is supposed to be happening? My guess is that something IS happening, except your callback functions are not returning anyt...

why nothing is happening when i am calling other function in other button?

what is supposed to be happening? My guess is that something IS happening, except your callback functions are not returning anyt...

nästan 3 år ago | 0

Answered

GUI Ignoring Changes to figure.Pointer Without a pause() command

add in a drawnow() command after you change the cursor.

GUI Ignoring Changes to figure.Pointer Without a pause() command

add in a drawnow() command after you change the cursor.

nästan 3 år ago | 0

| accepted

Answered

Calling function with set parameters

You can put all those graphic objects into an array, same for the strings and other parameters. then use a forloop. short examp...

Calling function with set parameters

You can put all those graphic objects into an array, same for the strings and other parameters. then use a forloop. short examp...

nästan 3 år ago | 0

| accepted

Answered

Filtering matlab table like a database or via dropdown menu

Yes! I would suggest creating the gui through uicontrol() programmatically (not via GUIDE): https://www.mathworks.com/help/matl...

Filtering matlab table like a database or via dropdown menu

Yes! I would suggest creating the gui through uicontrol() programmatically (not via GUIDE): https://www.mathworks.com/help/matl...

nästan 3 år ago | 0

| accepted

Answered

Photo and Text with Dropdown Menu

use uicontrol to create a text box: https://www.mathworks.com/help/matlab/ref/uicontrol.html and imshow to create your image: ...

Photo and Text with Dropdown Menu

use uicontrol to create a text box: https://www.mathworks.com/help/matlab/ref/uicontrol.html and imshow to create your image: ...

nästan 3 år ago | 0

Answered

How do I create a call back function that updates a "Label" when I push a button? (Calculator)

assign a tag to your label, which I assume is a text graphic object. example: txt1.Tag = 'label1'; function button_1callbac...

How do I create a call back function that updates a "Label" when I push a button? (Calculator)

assign a tag to your label, which I assume is a text graphic object. example: txt1.Tag = 'label1'; function button_1callbac...

nästan 3 år ago | 1

Answered

How can I share data from a uitable into the workspace of a timer function that reruns periodically?

sounds like maybe the handle for your uitable is out of the scope of the function. Etiher pass it as an input, or assign a tag t...

How can I share data from a uitable into the workspace of a timer function that reruns periodically?

sounds like maybe the handle for your uitable is out of the scope of the function. Etiher pass it as an input, or assign a tag t...

nästan 3 år ago | 1

| accepted

Answered

How do I fit my data to a cos^2?

All I used was the plot function and I got something pretty sinusoidal theta = [90, 110, 130, 135, 150, 170, 180, 190, 210, 225...

How do I fit my data to a cos^2?

All I used was the plot function and I got something pretty sinusoidal theta = [90, 110, 130, 135, 150, 170, 180, 190, 210, 225...

nästan 3 år ago | 0

Answered

Error using reshape and permute

a 17*11*11 matrix contains 2057 elements, you have 1800.

Error using reshape and permute

a 17*11*11 matrix contains 2057 elements, you have 1800.

nästan 3 år ago | 0

| accepted

Answered

UI push buttons play audio

if you want to create your ui programmatically, check this out: https://www.mathworks.com/help/matlab/ref/uicontrol.html if yo...

UI push buttons play audio

if you want to create your ui programmatically, check this out: https://www.mathworks.com/help/matlab/ref/uicontrol.html if yo...

nästan 3 år ago | 1

| accepted

Answered

Unable to perform two for loops, with a set value from first for loop into second loop

The problem is that your Emax is defined as a 1x3 array. So I think you meant to index your p_limit vector. Heres sort of what ...

Unable to perform two for loops, with a set value from first for loop into second loop

The problem is that your Emax is defined as a 1x3 array. So I think you meant to index your p_limit vector. Heres sort of what ...

nästan 3 år ago | 0

| accepted

Answered

How do I make a smooth curve using the following data?

figure x1 = [0,0.0521,0.1042, 0.1563, 0.2083, 0.2604, 0.3125, 0.3646, 0.4167]; x1q = linspace(x1(1),x1(end),100); y1 = [2.401...

How do I make a smooth curve using the following data?

figure x1 = [0,0.0521,0.1042, 0.1563, 0.2083, 0.2604, 0.3125, 0.3646, 0.4167]; x1q = linspace(x1(1),x1(end),100); y1 = [2.401...

nästan 3 år ago | 1

| accepted

Answered

Plotting two sets of 3D points on same graph

You can plot multiple points on a graph by using the hold on function. take a look: https://www.mathworks.com/help/matlab/re...

Plotting two sets of 3D points on same graph

You can plot multiple points on a graph by using the hold on function. take a look: https://www.mathworks.com/help/matlab/re...

nästan 3 år ago | 1

Answered

how to make a push button to be pressed 3 times after other push button is pressed ?

You can jsut call out the callback for pushbutton2 three times in your callback for pushbutton1. button1 = uicontrol('style','...

how to make a push button to be pressed 3 times after other push button is pressed ?

You can jsut call out the callback for pushbutton2 three times in your callback for pushbutton1. button1 = uicontrol('style','...

nästan 3 år ago | 1

| accepted

Answered

How to use a vector to make a graph?

https://www.mathworks.com/help/matlab/ref/hold.html https://www.mathworks.com/help/matlab/ref/scatter.html

How to use a vector to make a graph?

https://www.mathworks.com/help/matlab/ref/hold.html https://www.mathworks.com/help/matlab/ref/scatter.html

nästan 3 år ago | 0

Answered

fill table with data from text box

I am assuming you are using the uitable, you can just directly edit the data on the table by setting the ColumnEditable property...

fill table with data from text box

I am assuming you are using the uitable, you can just directly edit the data on the table by setting the ColumnEditable property...

nästan 3 år ago | 0

| accepted

Answered

System of equations error

syms x y z sol=solve([x==5 ,-6*x+10*y-3*z == 0,-y+51*z==0],[x y z])

System of equations error

syms x y z sol=solve([x==5 ,-6*x+10*y-3*z == 0,-y+51*z==0],[x y z])

nästan 3 år ago | 0

Answered

Replacing values based on a condition in a matrix.

%let M be your matrix; ind = M(:,2) > 20; %grab indices along second column where value is > 20 M = num2cell(M); % youre going...

Replacing values based on a condition in a matrix.

%let M be your matrix; ind = M(:,2) > 20; %grab indices along second column where value is > 20 M = num2cell(M); % youre going...

nästan 3 år ago | 0

Answered

I'm trying to plot these points, please help?

x=10:1:110; W=500; L=120; h=50; y=(W*L)*(sqrt((h^2)+(x.^2)))./(h.*x) ; figure plot(x,y) things to note: define the varia...

I'm trying to plot these points, please help?

x=10:1:110; W=500; L=120; h=50; y=(W*L)*(sqrt((h^2)+(x.^2)))./(h.*x) ; figure plot(x,y) things to note: define the varia...

nästan 3 år ago | 0

| accepted

Answered

How to use a loop to get the final result stated in problem

t=2; kr=2; s=[0;0]; R=[2 3; 3 4]; D=[4 5; 5 6]; s1=zeros(kr,t); S = []; for n = 1:100 for i=1:kr for j=1:t ...

How to use a loop to get the final result stated in problem

t=2; kr=2; s=[0;0]; R=[2 3; 3 4]; D=[4 5; 5 6]; s1=zeros(kr,t); S = []; for n = 1:100 for i=1:kr for j=1:t ...

nästan 3 år ago | 0

| accepted

Answered

Is it possible to detect and replace abnormal/wrong numbers in an array?

A = [25.9, 25.9, 26.2, 27, 28, 29, 29.3, 29.6, 3, 30.4, 30.5, 30.4, 30.3, 30.3] abnorm =mean(A) - 3*std(A); % you can set howe...

Is it possible to detect and replace abnormal/wrong numbers in an array?

A = [25.9, 25.9, 26.2, 27, 28, 29, 29.3, 29.6, 3, 30.4, 30.5, 30.4, 30.3, 30.3] abnorm =mean(A) - 3*std(A); % you can set howe...

nästan 3 år ago | 1

| accepted

Answered

Randi except one variable

I would suggest generating a mxn randi matrix, and just changing the one index to whatever value you wanted it to be.

Randi except one variable

I would suggest generating a mxn randi matrix, and just changing the one index to whatever value you wanted it to be.

nästan 3 år ago | 0

Answered

MATLAB GUI, using guide

The table has a 'Data' property. So you can do something like this: table_handle.Data = data_matrix %or set(table_handle,'Da...

MATLAB GUI, using guide

The table has a 'Data' property. So you can do something like this: table_handle.Data = data_matrix %or set(table_handle,'Da...

nästan 3 år ago | 0

| accepted

Answered

Calling variables from a GUI into a script

The variables are undefined because your graphic objects have lost their handles, because those handles are beyond the scope of ...

Calling variables from a GUI into a script

The variables are undefined because your graphic objects have lost their handles, because those handles are beyond the scope of ...

nästan 3 år ago | 0