Community Profile

photo

Benjamin


Last seen: Today Active since 2013

Organism on the Earth

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
Why do I get unrecognized function or variable 'ft_version' ?
This would be a question for the makers of Fieldtrip, like the message says.

5 dagar 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...

5 dagar 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...

5 dagar 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...

5 dagar ago | 0

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...

6 dagar 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...

6 dagar 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 ...

6 dagar ago | 0

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

6 dagar 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...

11 dagar 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...

11 dagar 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),...

19 dagar 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...

19 dagar 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...

20 dagar 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.

20 dagar 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...

20 dagar 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...

27 dagar 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 ...

27 dagar ago | 0

Answered
How to change the fontsize of labels not axsis.
Try replacing those four lines of code with the following: h.FontName = 'Times New Roman'; h.XLabel.String = 'Angular(rad)'; ...

28 dagar ago | 0

Answered
I want to chose a function and use it in the code, but have the possibility to chose different functions, is it possible?
Try replacing your line with eval with the following: input_dpd = feval(baseStr,input_signal.x);

28 dagar ago | 0

Answered
How do I search for and collect column data based on column name?
name = 'AM'; subject = ["1.1_", "1.2_", "2.1_", "2.2_"]; Pos = ["LHS-LHS", "RHS-RHS"]; Search = {'LKneVel' 'LKneMom' 'LKneP...

ungefär en månad ago | 0

| accepted

Answered
Error: This statement is incomplete.
Pass j to sprintf three times instead of one: for j = 1:12 eval(sprintf('factor_2017_%d = trapz(year_2017_%d(:,4))/trapz(y...

ungefär en månad ago | 0

Answered
Convert Cell Array into equation
If C is a cell array containing a MATLAB expression in each cell, then the following code will evaluate the expressions and retu...

ungefär en månad ago | 0

| accepted

Answered
How to make the negative sign in the legend easier to see?
You can get some more space by using cell arrays in strcat (because strcat trims white space off the ends of character arrays): ...

ungefär en månad ago | 1

Answered
extracting values from a matrix
If M is your matrix, then block1 below will be a vector with all elements of M with value equal to 1, 2 or 3, in the order they ...

ungefär en månad ago | 0

Answered
No such file or directory for a found file.
files(n).name is just the file name, not the full path to the file, so you have to cd to the directory and/or refer to the file ...

ungefär en månad ago | 0

Answered
Porblem in exporting a txt file
Here's one way. This will collect the first three columns of each section into a cell array called data, each element of which c...

ungefär en månad ago | 0

| accepted

Answered
Correct way of using if-Function
The problem is that you are using the index i instead of v1(i) (or maybe it should be v2(i) - no way to tell) in your comparison...

ungefär 2 månader ago | 1

Answered
Matlab and Fortran Precision Issue
The value of F1 is different in MATLAB vs Fortran.

ungefär 2 månader ago | 0

Answered
help regarding for loop
Axb=[1 1 1 2 1 5 7;1 2 2 1 1 3 6;1 3 3 0 1 6 6;1 2 2 2 2 3 -8;1 1 1 1 1 6 8;3 5 9 3 4 3 1;2 2 5 1 8 9 5]; z = Axb(1,:); z(2,...

ungefär 2 månader ago | 1

| accepted

Answered
I don't understand this error in Matlab 2021a: Error using slice (line 65) V must be a 3-D array.
This error happens because fcw is not a 3-D array. You should inspect flux.data to see if it's what you expect.

ungefär 2 månader ago | 0

| accepted

Load more