# Benjamin

Organism on the Earth

**Statistics**

RANK**317**

of 246 832

REPUTATION**210**

CONTRIBUTIONS

**0** Questions

**89** Answers

ANSWER ACCEPTANCE **
0.00%
**

VOTES RECEIVED**19**

RANK

of 17 217

REPUTATION**N/A**

AVERAGE RATING**0.00**

CONTRIBUTIONS**0** Files

DOWNLOADS **0**

ALL TIME DOWNLOADS**0**

CONTRIBUTIONS**0 Posts**

CONTRIBUTIONS**0** Public Channels

AVERAGE RATING

CONTRIBUTIONS**0** Highlights

AVERAGE NO. OF LIKES

**Content Feed**

Why do I get unrecognized function or variable 'ft_version' ?

This would be a question for the makers of Fieldtrip, like the message says.

6 dagar ago | 0

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

6 dagar ago | 0

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

6 dagar ago | 0

| accepted

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

6 dagar ago | 0

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

7 dagar ago | 0

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

7 dagar ago | 0

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

7 dagar ago | 0

How do i extract data from 3D matrix?

[m,n,~] = size(A); newA = reshape(permute(A,[2 1 3]),m*n,[]).';

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

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

12 dagar ago

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

20 dagar ago | 0

| accepted

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

20 dagar ago | 1

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

21 dagar ago | 0

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.

21 dagar ago | 0

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

21 dagar ago | 1

| accepted

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

28 dagar ago | 0

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

28 dagar ago | 0

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)'; ...

29 dagar ago | 0

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);

29 dagar ago | 0

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

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

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

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

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

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

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

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

Matlab and Fortran Precision Issue

The value of F1 is different in MATLAB vs Fortran.

ungefär 2 månader ago | 0

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

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