Answered
I need to code a1, a2, a3 = 0. any idea how to do this? I've read about deal, but it seems too long to code 19-20 "a" variables.
Use a vector instead: a = zeros(1, 19); Now your "a1" is |a(1)|. It is not clear what "input the blade section data f...

9 years ago | 0

Answered
Matlab 2013 GUI handles returns a number rather then UIC
Exactly. This is the expected behavior. Since R2014b the graphic handles have been unique double numbers.

9 years ago | 0

Answered
Matlab 2d plotting for better clarity
PostScript. This does not look very smart on the screen, because Word displays the TIFF-preview only. But when printed on paper ...

9 years ago | 0

Answered
For loop to find yearly averages
You do not need a loop: s = size(RUNOFF); RunOffP = reshape(RUNOFF, s(1), s(2), 12, s(3) / 12); RunOffAvg =...

9 years ago | 1

| accepted

Answered
Faster version of dec2bin and bin2dec function for an image
|dec2bin| is not the problem, but the repeated calling. img = randi([0, 255], 256, 512); % Example data tic; [D1, D2...

9 years ago | 1

| accepted

Answered
How to replace elements if it is true
In |B(indx,2)=A(indx,2)| the index "indx" would concern both arrays. You need both outputs of |ismember| instead: [LiB, Loc...

9 years ago | 0

Answered
Can't open Image. Help me. Please
You define the callback as: pb = uicontrol([...], 'callback',@pb_Callback); Then it is called as function pb_Callba...

9 years ago | 0

Answered
How to loop a song until GUI is exited
Use |audioplayer| instead and define the |TimerFcn| with the length of the sample as period to restart the object.

9 years ago | 0

Answered
how to use a foor loop
Sorry for this disappoiting answer: No. The most reliable idea is to delete this code and re-write it from scratch. It is neithe...

9 years ago | 0

| accepted

Answered
Can someone explain to me whats off with this function handle?
Try this: [predator, prey] = lotka_volterra(@dy, [0 10], [4 4], 0.1)

9 years ago | 0

Answered
How to calculate the distance between matrixes
No. The Euclidean distance requires vectors with the same number of elements. You can define a new distance, which fills elem...

9 years ago | 1

Answered
I need help with my GUI, getting the pop-up menu to relate to a radio button and then a user input to convert a measurement.
Either use GUIDE, or create the GUI programmatically. For the latter case see: <https://www.mathworks.com/matlabcentral/fileexch...

9 years ago | 0

Answered
function not working with updateSystem for a slider in a GUI
b.Callback = {@myUpdateCB, s, co}; ... function myUpdateCB(hObject, EvenData, s, co) updateSystem(s, ode15s(dis(h...

9 years ago | 1

| accepted

Answered
How use function variables?
Using globals is a really bad idea. I will work at first, but as soon as the program grows, the problems will become worse a...

9 years ago | 0

Answered
How to convert emg signal to force
This is not a problem of Matlab, but a question concerning physiology. Therefore you ask in the wrong forum. You can find a l...

9 years ago | 0

Answered
How can I gernerate negative value in Vector
Perhaps: L = 14; V = -L:L; or V = -L:L; V = V(randperm(numel(V));

9 years ago | 1

| accepted

Answered
how to define a matrx type that each of its element is a matrix as well
A matrix cannot contain matrixes as elements. Eitehr use a cell array or a 3D-array, if all sub-matrices have the same size: ...

9 years ago | 0

Answered
How to accelerate exponent (exp) calculation in MATLAB?
No. |exp()| is an expensive operation. The only way to accelerate it is to reduce repeated calls with the same argument. I've...

9 years ago | 1

| accepted

Answered
Continue code if Message box OK is pressed
See as example <https://www.mathworks.com/matlabcentral/fileexchange/24871-autowarndlg FEX: AutoWarnDlg>: Opt.Delay = 15; ...

9 years ago | 0

Answered
How can I convert .hex file to .m file?
It depends on the contents of the hex file and what you want to achieve as M-file. Actually .hex files contain binary values...

9 years ago | 0

Answered
Licence Activation problem with my Dual Boot Windows and Ubuntu?
Uninstalling is not the problem, as long as the license is *actiavted* under Windows. So better deactivate the license. You can ...

9 years ago | 0

Answered
calculate the volume of 3d convex hull
The documentation of <https://www.mathworks.com/help/matlab/ref/convhulln.html |convhull|> mentiones the origin of the |qhull| l...

9 years ago | 0

Answered
How use of sprintfunction to load .dat file, mathematical operation, save as.txt file in a loop?
You can check this manually: sprintf('C:\Desktop\waxs_import_export\e16265_1_01729_00000_00%d.dat', 192) This replies th...

9 years ago | 2

Answered
Basic question about initializing variables
In a = zeros(1,3); a = [ 1 2 3 ]; Matlab reserves memory for 3 doubles and fills then with zeros in the first line. ...

9 years ago | 0

| accepted

Answered
How can I save the same array with different names (saving RAM memory)?
Such "shortcuts" are working in Matlab directly: Struct1.Struct2.Struct3.Struc4a = rand(1e6,1); Struct1.Struct2.Struct3....

9 years ago | 3

| accepted

Answered
Why some functions does not open?
The functions cannot be "opened", because they are compiled. Some functions of Matlab's toolboxes are shipped as M-files, some a...

9 years ago | 0

| accepted

Answered
Matlab error: “filpath” is not recognized as an internal or external command, operable program or batch file
The error message is clear: 'lib\sift\bin\siftfeat' is not recognized as an external function. Most likely this file is not exis...

9 years ago | 0

| accepted

Answered
For loop not working when run inside a function!
This sounds like magic: Calling the function Function within a script I get the error, but if I go inside the function and...

9 years ago | 0

| accepted

Answered
How do I update the workspace while a script is running in MATLAB?
Don't do this. A program, which relies on magic poofing of variables by the user, cannot work reliably. The results are not repr...

9 years ago | 1

Answered
Why do I receive error 353 or error 1616 'no more activations available' when attempting to activate MATLAB?
Yes, I assume so. Does your license allow you to install Matlab on 2 computers? Then deactivate it before trying to activate a n...

9 years ago | 0

| accepted

Load more