Answered
Select an unknown variable from .Mat file
matObj = matfile('YourFile.mat'); details = whos(matObj); [maxBytes, index] = max([details.bytes]); maxName = detail...

9 years ago | 0

| accepted

Answered
How do I split my matrix into an array of cells with separate matrices based on conditions?
This is a job for |unique('rows')|: [uA, ~, iuA] = unique(Call(:, [1, 2, 7]), 'rows'); n = size(uA, 1); step1 = c...

9 years ago | 0

| accepted

Answered
GUIDE openingFnc called more than once
Using a flag is perfect, but |if ~(exist('flag') == 1)| would be a very poor implementation. Remember that this would search in ...

9 years ago | 1

| accepted

Answered
n th order derivative using forward difference
Is this a homework? Then please mention this explicitly, because this requires a different kind of answering. Did you read th...

9 years ago | 0

Answered
Very basic calculations returning incorrect values
Of course the results are exactly, what they are expected to be. I assume, you expectations to the function |square| are wrong. ...

9 years ago | 2

| accepted

Answered
what does for j = [1:i-1, i+1:n] mean?
for j = [1:i-1, i+1:n] ... end is the same as: for j = 1:n if j ~= i ... end end It ru...

9 years ago | 3

| accepted

Answered
Check for .txt or .mat file
[fPath, fName, fExt] = fileparts(filename); switch lower(fExt) case '.mat' % A MAT file case '.txt' ...

9 years ago | 6

Answered
sir plz help me in dividing an image into 8*8 blocks using matlab & then to check whether number of 1s is larger than 0s,if larger number of 1s,then i need to convert all 0s to 1s,else convert all 1s to 0s.
I guess, that your input is a 2D image with a height and width dividable by 8. Then: img = randi([0 1], 64, 96); siz ...

9 years ago | 0

Answered
loop questions for k=1:n
This was answered in <https://www.mathworks.com/matlabcentral/answers/380778-the-loop-question-for-the-for-loop-k-1-n your other...

9 years ago | 1

Answered
using fullfile when you need to pass a string as an input argument with readable TreatAsEmpty
The problem is here: i assign the directory as A1 having after having converted it to a string You did not provide the co...

9 years ago | 0

| accepted

Answered
Butterworth filter in MATLAB: zero lag?
fc = 300; fs = 1000; [b,a] = butter(6,fc/(fs/2), 'low'); yy = filtfilt(b, a, y) If you ask an internet se...

9 years ago | 1

| accepted

Answered
How can I protect files other than .m file with Matlab compiler?
If you want to deliver encrypted files, encrypt them before the compilation. Then you Matlab code must contain the required decr...

9 years ago | 0

Answered
How does this code sum the first 100 even integers?
Apparently this code sums the first 100 integers. No, it does *not* do this. As mentioned in the title of your question, it ...

9 years ago | 0

Answered
Why doesn't this command work (vector addition)?
Did you read the error message? for x = 1:0.5:10 y(x) = x + 1 end produces: Subscript indices must eithe...

9 years ago | 0

Answered
about freqs_m function
The message is clear: The folders of the Matlab path do not contain this file. Most likely you want to download it at first, e.g...

9 years ago | 1

Answered
How should I get a plot of my data if the data matrix is too large ?
As I had guessed: Theta=zeros(size(XP,1)); This creates a square matrix: n = size(XP, 1); Theta = zeros(n, n...

9 years ago | 0

| accepted

Answered
How to use functions? why it is showing error?
|distrmu| is not a Matlab function. But if you ask an internet search engine, you will find a function with this name in the Fil...

9 years ago | 0

Answered
Blink LED at specify time with Matlab - Arduino
time = str2num(get(handles.edit3,'String')); % S = seconds(time); % [EDITED] Not needed writeDigitalPin(a, 'D13', 1)...

9 years ago | 1

| accepted

Answered
Why do my questions get very few views ?
No, the questions are not filtered. The rules have not been changed. If a question got a few views only, this means that only a ...

9 years ago | 0

Answered
How to vectorize for loops
@Evangelos: Omit useless code like: |u_right = u_right;| This is a waste of time only and confusing. Better replace if u_le...

9 years ago | 1

Answered
How to update data as website-source updates?
By using |urlread| or |urlwrite|? For a more specific answer, please explain, what the "current condition" is.

9 years ago | 0

Answered
Distance formula using while loop
Do not create a set of variables called "D1, D2, ...". See <https://www.mathworks.com/matlabcentral/answers/57445-faq-how-ca...

9 years ago | 0

| accepted

Answered
How can I combine these .csv files?
You did not tell us, what the contents of |Timestamps| and |Samples| is. Maybe it is much easier to concatenate the data *before...

9 years ago | 1

| accepted

Answered
Display video and save frames in the same time !
What does "in the same time" mean? Currently you run two loops after each other. What about inserting the code in *one* loop? ...

9 years ago | 0

Answered
quiet sound after save
This leaves some space for interpretations. * Are your earphones connected but you expect the sound to come from the speakers...

9 years ago | 0

| accepted

Answered
How can I change the MsgBox size?
You can't. The |msgbox| is drawn tight around the text. Either use a larger text, or write your own message box. See: edit ...

9 years ago | 0

Answered
How can i draw this in a plot
Maybe: x = [ 355 390 401 410 430 420 415 415 400] y = [ 190 210 220 225 225 221 220 220 205] plot(x) hold on pl...

9 years ago | 0

Answered
column vector dot multiplied with a row vector. Multiple such operations..
See * <https://www.mathworks.com/matlabcentral/fileexchange/37515-mmx-multithreaded-matrix-operations-on-n-d-matrices> * <ht...

9 years ago | 0

| accepted

Answered
Is it possible to change the the MATLAB window colors to something not blue and white?
If you mean the fore- and background of the command window, you can do this dynamically by <https://www.mathworks.com/matlabcent...

9 years ago | 0

Answered
I have a problem with square bracket in solving ode45
This is an evil behavior of Matlab, which tries to be _smart_: a = 1; b = 2; c1 = [a - b] % -1 c2 = [a -b] % ...

9 years ago | 0

Load more