Respondida
Assign values to a structure using App designer
There are two different types of edit fields in appdesigner (numeric and text). In the picture you show are only text edit field...

alrededor de 5 años hace | 0

Respondida
How to give output of one push button as input to another push button??
It would be really helpful to get any information about what you have tried and why it is not working (wrong result, error messa...

alrededor de 5 años hace | 0

Respondida
Skipping even indices in a for-loop and subsequently avoiding the odd values to appear in the output
When you assign a value to A(3,3)=1, Matlab will create a Matrix of the size 3,3 and will fill empty fields with 0. A(3,3)=1 ...

alrededor de 5 años hace | 0

| aceptada

Respondida
delete variable file name
Try this: delete(sprintf('%s.sim',newname))

alrededor de 5 años hace | 1

| aceptada

Respondida
I am trying to add two numbers in App designer code view and i am getting following error message
You need to access the value stored in your edit fields: a = app.EditField.Value; b = app.EditField2.V...

alrededor de 5 años hace | 1

| aceptada

Respondida
hObject error in execution of a checkbox
Your checkbox function does not know 'hObject': function checkbox() handles.fig=figure; handles.cbh = zeros(40,1); handl...

alrededor de 5 años hace | 1

| aceptada

Respondida
How to write repeating string with variables in for loop
Check if this works for you. for i=1:75 line1 = ' new ScreenItem(ScreenVideoComponent,'; line2 = sprintf(' Video...

alrededor de 5 años hace | 1

| aceptada

Respondida
Having some problems with recursive function
This strange behaviour originates in a unfortunate function name. function S = mySum(A) S = myplus(A, length(A)) function ...

alrededor de 5 años hace | 0

| aceptada

Respondida
Accessing the Value of Variables in the Workspace
You can load your data into a structure: s=load('MyData.mat'); Now you can use fieldnames to obtain all variable names in yo...

alrededor de 5 años hace | 1

| aceptada

Respondida
Undefined variable in app designer when the variable called in external function
Your external function does not know which variables you use in your app. You need to pass them along. Try changing else pr...

alrededor de 5 años hace | 0

| aceptada

Respondida
Vector loop over multiple object handles inside a set function
You can use logical indexing. I wrote this earlier today for another question, but it is quite close to what you want to do: ...

alrededor de 5 años hace | 0

Respondida
how to click push button one by one without visible the button?
You can use the enable property of a pushbutton. for i=3:-1:1 h.pb(i)=uicontrol('style','pushbutton','position',[50 50+(...

alrededor de 5 años hace | 0

Respondida
how to run function for several times with different variables
In your example you do not need more than one variable: a=[5 8 9 11]; for i=1:numel(a) n=a(i)*0.1:a(i)*0.1:a(i); for...

alrededor de 5 años hace | 0

Respondida
Correct evaluation of a logical statement, incorrect result?
It would be helpful to see your code, to find any errors. This should work fine: A=rand(96,6); D=5; B=zeros(96,6); C=3*one...

alrededor de 5 años hace | 1

| aceptada

Respondida
Reshaping an 1x365 matrix with daily observations within a year
You could add some zeros/NaNs at the end of your 365 datapoints, then you should be able to reshape: A=randi(100,365,1); A(e...

alrededor de 5 años hace | 0

Respondida
script for looping function
You just need to get rid of the (t,f1,f2) before the '=' when defining your function. You need to take a look at your loop aswel...

alrededor de 5 años hace | 0

Respondida
GUI handle structure not updating
You can use drawnow to update your graphic elements: function figure1_WindowKeyPressFcn(hObject, eventdata, handles) key = get...

alrededor de 5 años hace | 0

| aceptada

Respondida
How to write a code for an iteration?
f=zeros(100,4); f(1,:)=[1 5 10 15]; for i=2:100 f(i,:)=[f(i-1,1)+f(i-1,2),f(i-1,3)+f(i-1,4),f(i-1,1)-f(i-1,2),f(i-1,3)-f(...

más de 5 años hace | 0

| aceptada

Respondida
Please help me fix the count for the nested for-loop
Your addHexNumber function actually does not work correctly. I think you need to change if bothSum > 16 to if bothSum > ...

más de 5 años hace | 1

Respondida
Indexing a variable value
function density = FindDensity(DataDensity,position) [~,idx]=min(abs(DataDensity(:,1)-position)); density=DataDensity(idx,...

más de 5 años hace | 0

Respondida
Problem with for loop
The problem is that find might return an empty vector and in that case the assignment fails. You could catch this error by che...

más de 5 años hace | 1

Respondida
How can I create a function that inputs a row
You can read about functions here. function res=myfunc(matrix,row) %function [output1,output2]=functionname(input1,input2) ...

más de 5 años hace | 0

Respondida
I need a 'reset' push button to reset all other push buttons
Without seeing your code it is hard to provide an answer. If the enabling works your probably did not set the string property of...

más de 5 años hace | 1

Respondida
How to allow user to retrieve indices for particular value in an array, not the value itself?
In your example you use the _find_ function on only 1 value ( _min()_ returns 1). You were close, _min()_ can actually return...

más de 5 años hace | 0

| aceptada

Respondida
Why do I receive empty outputs in cell arrays after an if statement?
You nested your if statements, hence the last statement if C(j,2) < crvalue{1} will only be executed if the previous sta...

más de 5 años hace | 2

| aceptada

Respondida
how to construct if for vectors with positive and negative?
Small example to understand what is happening: Lets take a vector and check if all values are >0. test=1:5>0 In t...

más de 5 años hace | 1

| aceptada

Respondida
Keep getting this error code: Unable to perform assignment because the indices on the left side are not compatible with the size of the right side.
The left side is a single field in a matrix numericalData(i), this could for example be a number or a string. The right side is ...

más de 5 años hace | 0

| aceptada

Respondida
How can I fix the error "Index exceeds matrix dimension"
bcdof1 is a column vector you need to index bcdof1(i,1) instead of bcdof(1,i) bcdof1=[1;4;34;35;36]; bcdof=zeros(1,2*len...

más de 5 años hace | 1

| aceptada

Respondida
fprintf and for loop
for i=1:10 for j=1:2 fprintf('period %d step %d \nsave\n',i,j) end end

más de 5 años hace | 0

| aceptada

Respondida
Check an array of values if within an upper and lower limit
If you want to operate on arrays you could do it like this: x = 1:10; minVal = 2; maxVal = 6; x(x(x<=maxVal)>=minV...

más de 5 años hace | 0

| aceptada

Cargar más