Solved


Project Euler: Problem 2, Sum of even Fibonacci
Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 te...

6 years ago

Solved


Find the longest sequence of 1's in a binary sequence.
Given a string such as s = '011110010000000100010111' find the length of the longest string of consecutive 1's. In this examp...

6 years ago

Solved


Find the numeric mean of the prime numbers in a matrix.
There will always be at least one prime in the matrix. Example: Input in = [ 8 3 5 9 ] Output out is 4...

6 years ago

Answered
Add date stamp to time stamp
Hi, these commands will resolve your task: load BB EEE=datenum(HRV_BB3.Time); DATES = datestr(EEE, 'mm/dd/yy'); You'd n...

6 years ago | 0

Answered
Function of vector with letter grade
Hi, function GRADE = fun_degree(inp) if inp >=90 GRADE='A'; fprintf('Your score is %d and Your earned grade is A \n', i...

6 years ago | 1

Answered
How do you graph two equations on the same graph?
Hi, x = 0:.1:10; I = (-1/5000)*x+(.0018); plot(x,I), hold on %plot 2 q=1.6022e-19; C=28.73 ; T=273+C; ...

6 years ago | 0

Answered
Problem with using while
while .. end is not used correcly, use for ... end instead for i = 1:numImages % Read Image I = readimage(imds,...

6 years ago | 0

Answered
Fixing figure size to match fontsize
hi, Maybe this one can help you to solve your task: set(gcf, 'paperpositionmode', 'auto'); print(gcf, '-djpeg', '-r600', 'M...

6 years ago | 0

Answered
Change MATLAB character set encoding
Hi, Maybe this one helps with your problem: feature('DefaultCharacterSet','UTF-8'); Good luck

6 years ago | 1

Answered
plot a smith chart
Hi, Here is a useful help: https://www.mathworks.com/discovery/s-parameter.html Good luck.

6 years ago | 0

Answered
how to solve a linear equation
Hi, Here is the solution: syms P0 P1 P2 P3 % stable state syms u03 lamda13 lamda20 lamda21 u32 T= [1-...

6 years ago | 0

| accepted

Answered
How to make a parabolic interpolation?
Hi, An exact custom equation as asked in the question can be attained on step 5 Fit Model Type selection via Custom Equation ...

6 years ago | 0

Answered
Loop for comparing and plotting data
Hi Here is the corrected solution: load DayGroups.mat load DayGroups_t.mat for k = 1:size(DayGroups,1) for j = 1:s...

6 years ago | 0

| accepted

Answered
How to make a parabolic interpolation?
Hi, An easy solution is to employ the toolbox: cftool of MATLAB. Launch it: >> cftool Select X data: X Select Y data: Y S...

6 years ago | 0

Answered
Matlab Vehicle / Car Tracking / Kalman Filter / Noise Reducing
Hi, In your problem, you may employ the moving average filter: movavg() to reduce the influence of the noises. Good luck.

6 years ago | 0

Answered
Using same figure properties (e.g. current axes) onto new ones
hi, An easy way is to create/generate (MATLAB automatically) a plot building file from your already created plot figure via F...

6 years ago | 1

| accepted

Answered
timerange in a loop
How about this way: for ii=2012:2016 H{ii-2011,1} = [num2str(ii), '-01-01']; H{ii-2011, 2}= [num2str(ii), '-02-01'...

6 years ago | 1

Answered
How can i create MxN matrix?
Hi, you are going to create a linear system of equations (augmented matrix) 5001 - by - 1001, then A_M = ones(5001, 1001); ...

6 years ago | 0

Answered
timerange in a loop
Hi, What about this: for ii=2012:2016 H{ii-2011} = [num2str(ii), '-01-01',' : ', num2str(ii), '-02-01']; end Good ...

6 years ago | 1

Answered
Variables keep overwriting when i change the name
Hi, You would need to create a small loop to run your simulink model via sim() command and every iteration results can be sav...

6 years ago | 0

Answered
error in running code
It is working. It has been tested in MATLAB 2019b (it is an M-file and not a function file in this test). It also runs well if s...

6 years ago | 0

Answered
Plot 2D graph - parameters explanation?
Hi, if I have understood your question correctly, the answer lies in ylim: ylim([-1.5 1.5]) And this plot is not obtained w...

6 years ago | 0

Answered
Designing a Notch Filter
% The signal processing toolbox of MATLAB has: iirnotch() % Import your wav file with: [y,Fs] = audioread('AUDIO_FIle.wav'); ...

6 years ago | 0

Answered
combinations and their sum
Hi, Here is a rather simple answer: [A1,A2,A3,A4] = ndgrid([1 2 1 2]); VERS = [A1(:), A2(:), A3(:), A4(:)] SUM_VERS = sum(...

6 years ago | 0

Answered
Need a help in this code
Hi, problem is in your loop set up: for i = n:1 % <---- ERROR fullRecon = idwt2(LL{i},LH{i},HL{i},fullRecon,'Haar'); en...

6 years ago | 0

| accepted

Answered
Error using imread>get_full_filename (line 566) File "PAT\NPatsmall\0.tif" does not exist.
Hi Abdallah, All of your folders from which you are trying to get data/images are added to the search path of your matlab. If...

6 years ago | 1

| accepted

Answered
How to save score from game and then load it when second attempt is made
Hi, Now it is running as anticipated. When you start with the following intialization (score is <6), e.g.: >> score=1; save ...

6 years ago | 0

| accepted

Answered
Bar plot axes size using text in X axis
Hi Here is the solution for x axis: xticks(1:numel(neworder(:,1))) F = neworder(:,1);set(gca,'FontSize',4); xtickangle(9...

6 years ago | 0

| accepted

Answered
Regarding language change in R2019b
Suppose that if you change the location, that should change. Since mathworks.com automatically detects the location and selects ...

6 years ago | 1

Answered
Find the number of outputs of a value.
Hi, Here is your code improved a bit and bugs removed: function [A, B, hypotenuse] = M(C) %This calculates the pythagorean ...

6 years ago | 0

Load more