Answered
GUI RadioButton Callback Error In Matlab
Change this: function pushbutton12_Callback(~, ~, ~) to this: function pushbutton12_Callback(hObject, eventdata, handles) Th...

5 years ago | 0

| accepted

Answered
I want to make a function of x that uses loop for (x-x(i))
Here's one way: mono_x = arrayfun(@(x)sprintf('(x-%.3f)',x),x,'UniformOutput',false); prod_x = arrayfun(@(i)sprintf('%s*',mono...

5 years ago | 1

Answered
How can I find average of a range of values of the first column in a two column matrix
If A is your two column matrix, then A_new below is the average values of the rows where the first column of A is greater than o...

5 years ago | 0

Answered
I want to call different user functions based on option values without using If or Case statement
f = {@Normal @hFlip @Transpose}; result = f{Opt}(A,B,C);

5 years ago | 1

| accepted

Answered
plotting subplot with different columns in the rows
You can use different grid sizes in subsequent calls to subplot without affecting the placement of plots created in previous cal...

5 years ago | 0

| accepted

Answered
How can i change a value in a vector by the average of himself and 2 others numbers of vector
You can use movmean. For example, A below should have the expected result: X = [1 2 3 4 5]; A = movmean(X,3);

5 years ago | 0

Answered
How do I disable a dropdown option?
str = app.dropdown1.String; % store dropdown1's list of options str(app.dropdown1.Value) = []; % remove the selected one app.d...

5 years ago | 1

Answered
How can I read in specific parts of an .inp file
There are many functions you can use to read text files. If you have a fixed number of lines you always want to skip before the ...

5 years ago | 0

Answered
How to fill a matrix with multiple row vectors within a loop?
The variable var is a character vector; var(i) is the ith element of that vector, an element which is a single character. So whe...

5 years ago | 0

Answered
How to generate permutations of a matrix with given restrictions.
Here's one way. First generate all permutations like you're doing, then do the following to remove those permutations from B tha...

5 years ago | 0

| accepted

Answered
Extracting the maximum value from each array of different dimensions in a cell?
Look into cellfun. You can likely do this: X_max = cellfun(@(y)max(y(:)),X);

5 years ago | 0

| accepted

Answered
Error using arrayfun All of the input arguments must be of the same size and shape
Change 'UniformOutpot' to 'UniformOutput' so that MATLAB doesn't think it's another input variable for f.

5 years ago | 0

Solved


The Piggy Bank Problem
Given a cylindrical piggy bank with radius g and height y, return the bank's volume. [ g is first input argument.] Bonus though...

5 years ago

Answered
Converting values to g
g_val = double(val)/4096*4*g-2*g; plot(g_val);

5 years ago | 0

Answered
How to add zeros to the end of a cell of array
B(end+1:numel(A)) = {'0'};

5 years ago | 0

| accepted

Answered
Insert degree symbol in axis title.
xt = get(gca,'XTick'); xtl = arrayfun(@(x)sprintf('%d\\circE',x),xt,'UniformOutput',false); set(gca,'XTickLabel',xtl);

5 years ago | 1

Answered
How can I add a new value to my array with pushbutton?
The variable A is a local variable in the function pushbutton2_Callback. Each time the callback executes a new A is created; tha...

5 years ago | 0

| accepted

Answered
Check for key strokes while running a separate loop
You can assign a WindowKeyPressFcn to the figure. You may want a WindowKeyReleaseFcn as well.

5 years ago | 0

Answered
Trying to replace for loop with faster code
The second output argument of the find function is column indices. In order to get indices in Loc_all where a match happens, you...

5 years ago | 1

| accepted

Answered
Index in position 2 exceeds array bounds (must not exceed 1) error while comparing an array with a value
This error happens because the line of code in your foor loop uses the loop index i as a column index in your variables, but you...

5 years ago | 0

| accepted

Answered
Creating a piecewise function
The line: y(k) = x-1; tries to assign the entire vector x-1 to a single element (the kth element) of y. Instead it should be: ...

5 years ago | 2

| accepted

Answered
Getting error using GUIDE
Try get(handles.txtA,'String') etc., with single quotes instead of double quotes.

5 years ago | 0

Answered
Index in position 2 exceeds array bounds
This means that the code is attempting to refer to an index of some variable, but the variable is not large enough in that dimen...

6 years ago | 0

Answered
The while loop wont stop at the end when all attempts are failed.
I think, after the end of the first inner while loop, which starts like this: while(riddlescheck==true && riddlecounter1<4) yo...

6 years ago | 0

Answered
Function returns mapping to another function variable
1. "ans" shows the value of "absx" because that is the first output argument from the function my_first_function1. To suppress "...

6 years ago | 0

| accepted

Answered
Break loop with button click Appdesigner GUI [Both plot and button are in different callback functions]
You can define a variable that says whether the button has been clicked. Set the value of that variable in your button's callbac...

6 years ago | 0

Solved


Find Logic 32

6 years ago

Solved


Dot Product

6 years ago

Solved


Solve the equation. Find X.

6 years ago

Load more