Answered

How do I set a class property?

This might help as a start >> vec = vector; >> vec.v1 ans = 120 >> where classdef vector properties v1 ...

How do I set a class property?

This might help as a start >> vec = vector; >> vec.v1 ans = 120 >> where classdef vector properties v1 ...

alrededor de 9 horas ago | 0

| accepted

Answered

Unknown File/Folder in directory

"What does this mean, I dont Understand." I assume that you refer to 34 and 36, respectively. Main_File is a struct array with...

Unknown File/Folder in directory

"What does this mean, I dont Understand." I assume that you refer to 34 and 36, respectively. Main_File is a struct array with...

3 días ago | 0

| accepted

Answered

Select Specific NC Files in Folder Using Date Included in Filename

Something like this should do it matrix = [ 6, 4, 1980 6, 4, 1981 ]; dates = string( datestr( [matrix(:,[3,1,2...

Select Specific NC Files in Folder Using Date Included in Filename

Something like this should do it matrix = [ 6, 4, 1980 6, 4, 1981 ]; dates = string( datestr( [matrix(:,[3,1,2...

4 días ago | 1

Answered

clarification in for loop with intervals

Someting like this %% indicies = {[55:1:65], [125:1:145], [201:1:225]}; for jj = 1 : numel( indicies ) for kk = indicies...

clarification in for loop with intervals

Someting like this %% indicies = {[55:1:65], [125:1:145], [201:1:225]}; for jj = 1 : numel( indicies ) for kk = indicies...

6 días ago | 0

| accepted

Answered

How to add an element to cell?

One way >> the_cell={'January','March','April'}; >> the_cell = cat( 2, the_cell(1), {'February'}, the_cell(2:end ) ) the_cell...

How to add an element to cell?

One way >> the_cell={'January','March','April'}; >> the_cell = cat( 2, the_cell(1), {'February'}, the_cell(2:end ) ) the_cell...

7 días ago | 0

| accepted

Answered

how to change the number that decreases in the array element to the same number, for example 0 (zero)

Is something like this what you are asking for? %% a = [100.001469926008 0.0140073495254864 0.00452326089811489 ... ...

how to change the number that decreases in the array element to the same number, for example 0 (zero)

Is something like this what you are asking for? %% a = [100.001469926008 0.0140073495254864 0.00452326089811489 ... ...

8 días ago | 0

Answered

Why I get this error for my code?Error: File: Untitled2.m Line: 10 Column: 8

Replace x2=x1. / max(x1); by x2=x1 ./ max(x1); Be careful with where you add spaces

Why I get this error for my code?Error: File: Untitled2.m Line: 10 Column: 8

Replace x2=x1. / max(x1); by x2=x1 ./ max(x1); Be careful with where you add spaces

23 días ago | 1

| accepted

Answered

Convert char to variable

"by means of OOP, to create an app" Object Oriented Design isn't easy and there are many different solutions to a problem. I ...

Convert char to variable

"by means of OOP, to create an app" Object Oriented Design isn't easy and there are many different solutions to a problem. I ...

24 días ago | 0

| accepted

Answered

Importing Data from Text File Loop

First you need to create an array of file specifications. I prefer to use the function dir() glob = fullfile( "C:\Users\nperson...

Importing Data from Text File Loop

First you need to create an array of file specifications. I prefer to use the function dir() glob = fullfile( "C:\Users\nperson...

26 días ago | 0

Answered

Extending the number of terms in a specific sequence.

A copy&paste mistake: synth_f1 = synth_f1 - (1/(n*n))*sin(n*w*t) + (1/((n+2).^2))*sin((n+2)*w*t); % ...

Extending the number of terms in a specific sequence.

A copy&paste mistake: synth_f1 = synth_f1 - (1/(n*n))*sin(n*w*t) + (1/((n+2).^2))*sin((n+2)*w*t); % ...

alrededor de 1 mes ago | 1

Answered

Accessing subclass methods from abstract superclass

This is not what you ask for, but close. (I don't think what you want is possible with Matlab.) >> child = ChildClass(); >> ch...

Accessing subclass methods from abstract superclass

This is not what you ask for, but close. (I don't think what you want is possible with Matlab.) >> child = ChildClass(); >> ch...

alrededor de 1 mes ago | 1

Answered

Best way to truncate imported data so the plot displays the area of interest

One simple interactive way (R2018b) %% some data noise = rand( 0.5e6, 1 ); roi = 4.5*sin( (1:5e3)/(20*pi) )'; data = [ noi...

Best way to truncate imported data so the plot displays the area of interest

One simple interactive way (R2018b) %% some data noise = rand( 0.5e6, 1 ); roi = 4.5*sin( (1:5e3)/(20*pi) )'; data = [ noi...

alrededor de 1 mes ago | 0

| accepted

Answered

Import hours from a excel file

It can be done with https://se.mathworks.com/help/matlab/ref/duration.html. , but that requires more reading of the documentatio...

Import hours from a excel file

It can be done with https://se.mathworks.com/help/matlab/ref/duration.html. , but that requires more reading of the documentatio...

alrededor de 1 mes ago | 0

Answered

Combining Matrices into one

"I have 20 matrices" are those <68x68 double>? "matrices" implies that. If yes, try %% numfiles = 29; Ws = nan(68,68,numfi...

Combining Matrices into one

"I have 20 matrices" are those <68x68 double>? "matrices" implies that. If yes, try %% numfiles = 29; Ws = nan(68,68,numfi...

alrededor de 1 mes ago | 0

Answered

What frustrates you about MATLAB? #2

It frustrates me that else if is legal (R2018b) %% if length(c) > 1 d(end + 1,1) = 1; else if length(c) == 1 %#ok<S...

What frustrates you about MATLAB? #2

It frustrates me that else if is legal (R2018b) %% if length(c) > 1 d(end + 1,1) = 1; else if length(c) == 1 %#ok<S...

alrededor de 1 mes ago | 1

Answered

Creating a growing list

Add Joey = cell(0); before the loops and replace Joey = {('Bi**h Changed'),r,c} by Joey(end+1:end+3) = {('Bi**h Changed'...

Creating a growing list

Add Joey = cell(0); before the loops and replace Joey = {('Bi**h Changed'),r,c} by Joey(end+1:end+3) = {('Bi**h Changed'...

alrededor de 1 mes ago | 0

| accepted

Answered

What frustrates you about MATLAB? #2

It frustrates me that enumeration events methods properties are not reserved keywords (in R2018b). The statement meth...

What frustrates you about MATLAB? #2

It frustrates me that enumeration events methods properties are not reserved keywords (in R2018b). The statement meth...

alrededor de 1 mes ago | 0

Answered

how, using a for loop, can I create an array

how using a for loop V and A are overwritten for every iteration of the loop. Try this vec = [.25:.25:4]; len = length( vec ...

how, using a for loop, can I create an array

how using a for loop V and A are overwritten for every iteration of the loop. Try this vec = [.25:.25:4]; len = length( vec ...

alrededor de 2 meses ago | 0

| accepted

Answered

How to repeat run

Put your script in a function and call it 50 times for jj = 1 : 50 [ Ergebnis2p, Ergebnis3p ] = good_name( ); % store...

How to repeat run

Put your script in a function and call it 50 times for jj = 1 : 50 [ Ergebnis2p, Ergebnis3p ] = good_name( ); % store...

alrededor de 2 meses ago | 0

| accepted

Answered

Evaluating Method for multiple Objects, without using Eval

Q1: Yes (I don't understand why you thought of using eval/evalin.) Q2: ??? Q3: Yes, e.g. array of instancies of Class_2 The ...

Evaluating Method for multiple Objects, without using Eval

Q1: Yes (I don't understand why you thought of using eval/evalin.) Q2: ??? Q3: Yes, e.g. array of instancies of Class_2 The ...

alrededor de 2 meses ago | 0

| accepted

Answered

plotting in matlab using while loop

The answer ought to be, step throw the code and observe what each line of code makes to your diagram. However, the problem is t...

plotting in matlab using while loop

The answer ought to be, step throw the code and observe what each line of code makes to your diagram. However, the problem is t...

alrededor de 2 meses ago | 0

| accepted

Question

How to hinder ongoing spamming II?

For the record: Ongoing spamming from https://se.mathworks.com/matlabcentral/profile/authors/20474294 noom gmaukel franque da...

alrededor de 2 meses ago | 3 answers | 0

Answered

Reference to non-existent field 'recording'.

%% clearvars a=1; b=2; X.data = 17; save( 'recording.mat' ); %% question_6 = load('recording.mat') outputs question_6 = ...

Reference to non-existent field 'recording'.

%% clearvars a=1; b=2; X.data = 17; save( 'recording.mat' ); %% question_6 = load('recording.mat') outputs question_6 = ...

2 meses ago | 0

Answered

how can i make this animation faster in MATLAB?

"[...] to make a ball bounce back and forth between to walls" This is as fast as it gets - I think (with m-code) %% x=1;y=1; ...

how can i make this animation faster in MATLAB?

"[...] to make a ball bounce back and forth between to walls" This is as fast as it gets - I think (with m-code) %% x=1;y=1; ...

2 meses ago | 0

Answered

Resampling two signals to the same frequency

Comments The letter "A" as the name of the variable, which holds the force data, is a poor choice. There is half a second mor...

Resampling two signals to the same frequency

Comments The letter "A" as the name of the variable, which holds the force data, is a poor choice. There is half a second mor...

2 meses ago | 0

| accepted

Answered

Find index of points between two points?

>> A =[1,2,5,8,4,7,6,3,12]; >> Y_min=5; >> Y_max=7; >> idx = find((A>Y_min) & (A<Y_max)); >> idx idx = 7 See L...

Find index of points between two points?

>> A =[1,2,5,8,4,7,6,3,12]; >> Y_min=5; >> Y_max=7; >> idx = find((A>Y_min) & (A<Y_max)); >> idx idx = 7 See L...

2 meses ago | 0

Answered

Comparing elements in a vector

"My idea is to start of squaring the elements in x and then to check if any element in x equals any element in sqr." That's a g...

Comparing elements in a vector

"My idea is to start of squaring the elements in x and then to check if any element in x equals any element in sqr." That's a g...

3 meses ago | 0

| accepted

Answered

Why Matlab becomes 100 time slower using vector?

I've edited my answer, chosen better names rerun the tests deleted a profiler result, which I cannot reproduce. I don't kn...

Why Matlab becomes 100 time slower using vector?

I've edited my answer, chosen better names rerun the tests deleted a profiler result, which I cannot reproduce. I don't kn...

3 meses ago | 1

Answered

convert time in seconds after midnight to a certain interval

The script %% obj = duration( 0, 0, 2*3600+7*60 ); obj - mod( obj, minutes(5) ) outputs ans = duration 02:05:00 >>...

convert time in seconds after midnight to a certain interval

The script %% obj = duration( 0, 0, 2*3600+7*60 ); obj - mod( obj, minutes(5) ) outputs ans = duration 02:05:00 >>...

3 meses ago | 0

Answered

Unrecognized function or variable 'x'

"Unrecognized function or variable 'get_image_center'." Replace im_cntr = get_image_center(im); by im_cntr = self.get_image_...

Unrecognized function or variable 'x'

"Unrecognized function or variable 'get_image_center'." Replace im_cntr = get_image_center(im); by im_cntr = self.get_image_...

3 meses ago | 0