Answered
matlab reopening for every script
Did you try <https://www.mathworks.com/matlabcentral/fileexchange/51165-matlab-file-association-fix> already? See also: <http...

9 years ago | 1

Answered
Dice roll, how to write if statement for not 6 or 1?
if any(x(1) == 2:5) && any(x(2) == 2:5) winnings = winnings + 1; end You can do this in 1 line also: winning...

9 years ago | 0

| accepted

Answered
How to properly index a matrix in a for loop
The FOR loop take one element after the other and provides it to the body: k = 0; for a = [1 1 0 1 1 0 1] k = k + 1...

9 years ago | 1

Answered
how do i make an expression to the left of the equals sign a valid target so i can get rid of this error?
Please post the *complete* error message, if you mention, that there is a problem. Thanks. This will fail also: newt...

9 years ago | 0

Answered
Unable to calculate xcorr in for loop
A simplification to avoid repeated calculations: L = size(wg1, 1); % Better than: length(wg1(:,k)) for k = 2:numel(rep)...

9 years ago | 1

| accepted

Answered
What does the following error means
The error message seems to be clear and easy: Undefined function or variable 'functionOutageFormula'. There is no M-file ...

9 years ago | 0

Answered
arrenging rows and columns ?
lat = [-90 -60 -30 00 30 60 90]'; long = [ -160 -120 -80 -40 00 40 80 120 160 ]; nLat = length(lat); nLong = leng...

9 years ago | 2

| accepted

Answered
How to detect which instance of MATLAB I am working from
As far as I understand, it is not defined anywhere, what the "instance" is. Then Matlab cannot detect it automatically. Start...

9 years ago | 1

| accepted

Answered
imread>get_full_filename (line 504)
The problem is explained in the error message: File: fopen.m Line: 1 Column: 25 The input character is not valid f...

9 years ago | 0

| accepted

Answered
Create an array of empty durations
I asssume that <https://www.mathworks.com/help/matlab/ref/nat.html>: "Not-a-Time" does not help directly. What about: durat...

9 years ago | 1

Answered
GUI check state of radio button in another callback
if handles.radio1.Value == 1 % code elseif handles.radio2.Value == 1 % other code end Here I guess, that yo...

9 years ago | 3

| accepted

Answered
Indexing problems using for loop and if statements
Does this appear in the function to be integrated? Then it is not smooth and in consequence ODE45 cannot integrate it reliably. ...

9 years ago | 0

Answered
Is a 10 gigabit ethernet worth it for a matlab cluster?
Would I see any benefits from an upgrade to 10 gigabit network on distributed processing? If your distributed computations...

9 years ago | 0

| accepted

Answered
HOW TO CONVERT .m INTO .mat file
You can't. Or you do not want to. At least you shouldn't. M-files are scripts or functions. This means, that they contain cod...

9 years ago | 0

| accepted

Answered
How to find the largest product?
And a vectorized version: function [P, Ind] = max_product(v, n) X = v((1:numel(v) - n + 1) + (0:n-1).'); [P, I...

9 years ago | 0

Answered
Get drawable axis position after axis equal
See <https://www.mathworks.com/matlabcentral/answers/5882-getting-the-axis-position-correctly> : The properties TightInset and P...

9 years ago | 0

| accepted

Answered
How can I change terminator character in file reading?
A text file can contain different line breaks, e.g. if you edit in in different editors. |fgetl| removes *all* line breaks, such...

9 years ago | 0

Answered
Matrix manipulation and interpolation
Maybe you want to shifft the output one element to the right and bottom: [Xo,Yo] = meshgrid(0.5:0.5:S(2)+0.5, 0.5:0.5:S(1)+...

9 years ago | 1

| accepted

Answered
Is it possible to partially compile a GUI and still use it from Matlab in order to access the toolboxes functionalities?
You can p-code the M files. This is a certain level of protection, because the original source code cannot be recreated.

9 years ago | 1

Answered
Implementation of the filter function (Matlab) C/C++
You find the M-code, which creates the same output as |filter| <http://www.mathworks.com/matlabcentral/answers/9900-use-filter-c...

9 years ago | 2

| accepted

Answered
Load specific column from mat file
This is not possible in one command, but with a tiny function: function [a,b,c] = LoadColumn(FileName, col) Data = load(...

9 years ago | 0

Answered
How can I apply smooth curve fitting to my data
See <https://www.mathworks.com/help/signal/ref/envelope.html>

9 years ago | 0

| accepted

Answered
how to install matlab for 32 bit windows 8
Matlab 2015b was the last version which supports 32 bit under Windows. Did you select this release? Then I see a button to downl...

9 years ago | 0

Answered
Is there a keyboard shortcut to get the info about a variable in the editor?
What should the shortcut do? Without pointing the mouse on the wanted variable, it is unknown, which variable you want to displa...

9 years ago | 0

Answered
Is it possible to create a MULTIPLE INTERFACE DOCUMENT in MATLAB
Do you mean <http://www.mathworks.com/matlabcentral/fileexchange/23073-uisplitpane-split-a-container-figureframeuipanel-into-two...

9 years ago | 1

| accepted

Answered
Create a 3D Matric
You want a 3D array. Then define a 3D array: X = ones(2*n+1, 1, 4); for t = 1:3 B1 = vertcat(zeros(n,1),...

9 years ago | 0

Answered
Rotate linear array into an interpolated circle on a 2D plane?
n = 200; x = randperm(n, n); % Arbitrary [1 x n] vector k = -n/2:n/2; % n+1 values! k2 = k .^ 2 M = sq...

9 years ago | 0

| accepted

Answered
How to operate a function on some matrix element which is filtered?
valid = find(all(M < -45, 1)); nValid = length(valid); valueOfMLE = zeros(1, nValid); valueOfAvg = zeros(1, nValid);...

9 years ago | 0

Answered
Subscript indices must either be real positive integers or logicals?
I assume you want: for j = 1 : length (M) for i = 1:j % Not: M(1,1:j) if M(j) ~=0 && M(j) ~= 1 && M(j)~=2...

9 years ago | 1

Answered
How to make sure a script and the function file are saved in the right path
There are 2 kinds of M-file: scripts and functions. Both contain code. Functions start with the keyword "function" and then a li...

9 years ago | 0

Load more