Community Profile

photo

Benjamin


Last seen: Today Active since 2013

Statistics

All
  • Treasure Hunt Participant
  • Knowledgeable Level 3
  • Commenter
  • Leader
  • Promoter
  • Scholar
  • 3 Month Streak
  • CUP Challenge Master
  • Introduction to MATLAB Master
  • Community Group Solver
  • First Answer
  • Solver

View badges

Content Feed

View by

Answered
Expected one output from a curly brace or dot indexing expression
Is St_Name a length-3 character vector, .e.g., 'acb', by chance? I ask because it doesn't seem likely that St_Name can be used a...

alrededor de 20 horas ago | 0

Answered
Trying to increase marker size in scatter plot caused my plot and data to be replaced by a blank blue screen.
You are using T.Dynamic_Pressure as the marker size, right? Marker size is in units of points-squared. I have no idea what kind ...

alrededor de 21 horas ago | 0

| accepted

Answered
what changes should I make if my input is struct
function agepts = femaleldlchdrisk(S) if S.age <= 34 agepts = -9; elseif S.age <= 39 agepts = -4; ...

alrededor de 21 horas ago | 1

| accepted

Answered
There will be 12 plots and I want to show 12 plots in one picture.
Maybe subplot will work.

alrededor de 21 horas ago | 0

Answered
Plotting a circle on top of a trisurf graph.
It may be that the circle is beneath the surface object. I mean, I would expect the circle's 'ZData' to be all zeros - the defau...

alrededor de 22 horas ago | 0

| accepted

Answered
How to create a plot with highlight (holes) based on Y value and colored density map based on X value
To do #1, add the following lines of code after your plot(y) line: hold on idx = y>-0.5 & y<0.5; plot(t(idx),y(idx),'o');

1 día ago | 0

Answered
Extract data from dataset with no nans and loop over columns
I think, at least, these three lines: obsnew(m,n)=obs(m,n); sim1_new(m,n)=sim1(m,n); sim2_new(m,n)=sim2(m,n); should be mod...

1 día ago | 0

| accepted

Answered
size argument must be real integer
30000 bits 7 bits per symbol --> 30000/7 = non-integer number of symbols, i.e., you cannot reshape dataIn into a matrix of sym...

1 día ago | 0

| accepted

Answered
How do I add values into a vector
Here are four ways you can make a vector x that contains integers from 1 to 10. x = []; for i = 1:10 x(end+1) = i; end ...

1 día ago | 0

Answered
Saving loop values as column vector
d = zeros(1,25); c = 6.25; x = 2.5; for loop = 1:25 d(loop) = c-(c^-2+x*c); c = d(loop); end

1 día ago | 0

Answered
How do I store the results into a new matrix after looping it through every file.
Make B a cell array. Initialize it before your loop like this: B = cell(rows,1); Then store the result you get at the end of t...

1 día ago | 0

Answered
Can you explain to me the last part of this code? Thanks in advance!
y=roundn(a,-4); rounds a to the nearest multiple of 10^-4 and stores the result in y. Fw(isinf(Fw))=A0; replaces elements of ...

1 día ago | 0

| accepted

Answered
Sum matrix column orderly
This will work for your example_matrix: Final_matrix = movsum(example_matrix,3,1,'Endpoints','discard'); Maybe doing the same ...

1 día ago | 0

Answered
Why do I get unrecognized function or variable 'ft_version' ?
This would be a question for the makers of Fieldtrip, like the message says.

7 días ago | 0

Answered
how to run different for loops in MATLAB
I'm not sure how Matlaboptimization.m gets called at all; you should call it in your code without the .m extension, i.e.: PEMAX...

7 días ago | 0

Answered
Double for loop problem. Function within 2nd for loop no longer works properly.
Move this line: FS = a0*Q; into your outer for loop (but still outside the inner loop). This will re-initialize FS each time t...

7 días ago | 0

| accepted

Answered
I want to create a 'if' for a probability
ate_carrots_last_year = false; if ate_carrots_last_year P_eat_carrots_this_year = 0.8; else P_eat_carrots_this_yea...

7 días ago | 1

| accepted

Answered
How can I simulate a hiker who goes in a different direction every time?
The idea is that you have to add the new x and y steps to the previous position each time through the loop. Change your for lin...

8 días ago | 0

Answered
What wrong with my code? anyone can help?
That line is "if n == l" with a lower-case L, which is not a defined variable, evidently. Maybe it should be "if n == 1", with t...

8 días ago | 0

Answered
Convert x axis to seconds
If you do the following, does it look right? % plot 2, data rms plot(([1:nwindow]-1)/fs, data_rms, 'k*'); % plot 3, min data ...

8 días ago | 0

Answered
How do i extract data from 3D matrix?
[m,n,~] = size(A); newA = reshape(permute(A,[2 1 3]),m*n,[]).';

8 días ago | 0

| accepted

Solved


Goldbach's marginal conjecture - Write integer as sum of three primes
Goldbach's strong conjecture states that every even integer greater than 2 can be expressed as the sum of two primes. For exampl...

13 días ago

Solved


QWERTY coordinates
Given a lowercase letter or a digit as input, return the row where that letter appears on a standard U.S. QWERTY keyboard and it...

13 días ago

Answered
What mistake I am making?
Using a loop: function [avg] = avgpositive7multiples_for (m) s = 0; a = 0; for t = 1:length(m) if m(t) > 0 && mod(m(t),...

21 días ago | 0

| accepted

Answered
loop storing only the last value, I want all values of the loop to be stored
Note that your assignment to Ts is independent of the loop iterator a, so each time through the loop Ts is assigned the contents...

21 días ago | 1

Answered
Create a script file using control flow statements that returns all the prime numbers from 2 till hundred.
This solution does not use any control flow statements: numbers = 3:100; prime_numbers = numbers(isprime(numbers)); This solu...

22 días ago | 0

Answered
What is this peak's meaning?
It means that the magnitude of the Fourier transform of this rainfall data has a local maximum at that frequency.

22 días ago | 0

Answered
Create a cicle 'for' to create multiple fields
data = struct(); fn = {'C028' 'C022' 'C008' 'C006'}; for i = 1:numel(fn) data.(fn{i}) = getfield(importdata([fn{i} ' S1.m...

22 días ago | 1

| accepted

Answered
Madlab iseqaul edit field
I assume the global variable xaxis is a character vector, since it is being used in xlabel like one. If it is, then isequal(xaxi...

29 días ago | 0

Answered
how to calculate the area binary if some images have different pattern
You will have to adjust your code to handle cases when the number of regions in an image is not 4. In particular, the line for ...

29 días ago | 0

Load more