Answered
Plot with hidden information!!
This creates a point and an invisible text. If you click on the point, the ButtonDownFcn is triggered and the visibility is togg...

9 years ago | 0

Answered
How can I fix the error in the given below program?
|input| replies a double. According to the IEEE754 standard, a double has about 15 significant digits. Therefore you cannot inpu...

9 years ago | 0

Answered
How to solve system of second order differential equations
Your function calculates: xu = zeros(360,1) xs = zeros(360,1) y1 = (xs - xu) y2 = resample((diff(y1)),361,360) ...

9 years ago | 0

Answered
What is the accuracy of log() and other functions?
In the documentation of older Matlab version you found that e.g. |acos| was calculated using FDLIBM, see: <http://www.netlib.org...

9 years ago | 0

| accepted

Answered
please interpret this result from the filter function
You can use an M-version of |filter| and the debugger to step through the code line by line. This should reveal exactly, how the...

9 years ago | 0

| accepted

Answered
Creating a Variable Number of Nested 'for' Loops
Attention: Consider rounding effects: 0.1 + 0.1 + 0.1 == 0.3 % FALSE!!! So do not check if the sum equals 1.0 exactly,...

9 years ago | 0

Answered
Find random points inside binary mask
Using the linear index needs the half of the memory: index = find(mask); select = index(randperm(length(index), 1e4)); ...

9 years ago | 0

| accepted

Answered
passing data between gui
# Do not use "ans" as a variable. It is overwritten automatically by any uncaught output of a Matlab function. # Global variabl...

9 years ago | 0

Answered
how to insert an image to a variable (its not the usual one)
The purpose of |imagesc| is to display the image with scaled colors in an object of type |image|. If you state, that you want to...

9 years ago | 0

| accepted

Answered
OUtput names same as input names?
As soon as you are able to get the list of input names, it is trivial to use them as output names also. So maybe your question i...

9 years ago | 0

| accepted

Answered
help breaking nested for loop?
if i~=list_ind This does not do, what you want. You mean: if all(list(i) ~= list_ind) or if ~any(list(i) == li...

9 years ago | 0

Answered
single vs multiple fprintf() efficiency
Replace fprintf(fid, str1); by fwrite(fid, str, 'char') to avoid that |fprintf| tries to parse the string. Yo...

9 years ago | 0

Answered
problem trying to Install *.exe with Matlab 'system' command
Check the settings of your virus protection. Does it allow to start executables from the concerned folder?

9 years ago | 0

Answered
How to Define a Checkbox?
The discussion in the comments gets more complicated that the actual problem is. If you create a checkbox in GUIDE, the corre...

9 years ago | 2

Answered
How to shuffle rows of a matrix, say order 4, with the help of set having 4 elements, several times?
The |for i| loop over k is not needed: R = [1,2,3,4; 5,6,7,8; 9,10,11,12; 13,14,15,16]; k = [3,4,1,2]; for i = 1:3 ...

9 years ago | 1

| accepted

Answered
Dot product of a column vector by its own elements
With some guessing: X = [-0.0022, -0.0131, 0.9999; ... -0.8062, 0.2794, 0.5216; ... -0.9325, 0.0547, -0...

9 years ago | 0

| accepted

Answered
How to modify any text file via MATLAB programmatically?
Str = splitstr(fileread(FileName). \n'); Key = 'Specific word'; match = strncmp(Str, Key, length(Key)); Now |St...

9 years ago | 1

| accepted

Answered
What does this error " Undefined operator '*' for input arguments of type 'string' " means?
The error message is clear: In the failing line you try to multiply a string, but this is not meaningful. You know that the p...

9 years ago | 0

| accepted

Answered
to enable/ disable check box
If |handles.alles| and |handles.ein| are the handles of the radio-buttons, you need: if handles.alles.Value == 1 && handles...

9 years ago | 0

Answered
How to find the maximum value
t = 0.2:0.1:20; T = 600:50:850; for i = 1:numel(T) k1 = 1e7 .* exp(-12700 ./ T(i)); k2 = 5e4 .* exp(-10...

9 years ago | 0

| accepted

Answered
convert date string
[EDITED, cell string as input after Trader's comment] S = {'20120518 08:30:00', '20110519 09:40:00'}; C = sprintf('%s*',...

9 years ago | 0

Answered
Help creating a function library
Store this as an M-file: function Result = E(In1, In2, In3) Result = In1 * In2 + In3; end Now call this by: R...

9 years ago | 0

Answered
How do i use the edit text box in a GUI to change variables in a function ???
Search for the command "clear" in your code. Then find out, if it is needed there or if it destroys your data only. In the 2nd c...

9 years ago | 0

| accepted

Answered
input prompt do not work in callback function
This is a bug. Your code should show the prompt string in the command window. Please send a bug report to MathWorks. Use the ...

9 years ago | 2

| accepted

Answered
Finding distance between two points from 3D coordinates?
sqrt(sum((A - B) .^ 2)) or: norm(A - B)

9 years ago | 12

Answered
how to install matlab on linux without activation key or license number
As you have found out already, you need to get an online activation or a license key for Matlab. What you have to do is to obtai...

9 years ago | 0

Answered
Accessing a function from GUI1 in GUI2
What does "a function in GUI1 called Autoscaleimage" exactly mean? Is this a subfunction in the M-file GUI1.m? Then it might be ...

9 years ago | 0

| accepted

Answered
De-allocation un-used spalloc
I'd try it by: S = spalloc( 100000, 500, 2e6); ... fill in 1e6 values T = spalloc( 100000, 500, 1e6); T = S; In...

9 years ago | 0

Answered
What program should I use?
Any GUI can do what you are asking for: App Designer, GUIDE or a hand-made GUI using code. Fields to input data (1.) and to choo...

9 years ago | 1

| accepted

Answered
what is the function of (sub2ind)
The line is extreme nonsense. As John has said already, all it does is assigning a=20 . Without the confusing |eval|, it is:...

9 years ago | 3

| accepted

Load more