Answered

Sub-scripting a table

Try and replace hour20=MarchData(20==hour(MarchData.Date),:); by clock2000 = MarchData((hour(MarchData.Date)==20 & minute(Mar...

Sub-scripting a table

Try and replace hour20=MarchData(20==hour(MarchData.Date),:); by clock2000 = MarchData((hour(MarchData.Date)==20 & minute(Mar...

5 hours ago | 0

Answered

dlmwrite with text and numbers

Something like for jj = 1: len fprintf( fid, '___\n', num(jj), txt{jj} ) end is a standard approach Another answer is...

dlmwrite with text and numbers

Something like for jj = 1: len fprintf( fid, '___\n', num(jj), txt{jj} ) end is a standard approach Another answer is...

12 hours ago | 0

| accepted

Answered

trying to change negative values to 0 and positive to 1

The problem is somewhere else >> volts_add = randn(1,6); >> volts_add( volts_add <= 0 ) = 0 volts_add = 0.5377 1.8339...

trying to change negative values to 0 and positive to 1

The problem is somewhere else >> volts_add = randn(1,6); >> volts_add( volts_add <= 0 ) = 0 volts_add = 0.5377 1.8339...

1 day ago | 0

Answered

Read files with lat Long values ?

The comma delimited list of character vectors 'H\Adrij\documents\data_','_',lat{y,1},'_',lon{y,1} must be replaced by ONE st...

Read files with lat Long values ?

The comma delimited list of character vectors 'H\Adrij\documents\data_','_',lat{y,1},'_',lon{y,1} must be replaced by ONE st...

1 day ago | 0

Answered

Insert two elements in a multidimensional array

Something like this? %% N = 50; xh = zeros(2,N); %% Insert h1 and h2 into xh for jj = 1 : 2 : N ... [h1,h2] = cru...

Insert two elements in a multidimensional array

Something like this? %% N = 50; xh = zeros(2,N); %% Insert h1 and h2 into xh for jj = 1 : 2 : N ... [h1,h2] = cru...

2 days ago | 1

| accepted

Answered

Distance between all elements of row vector

Hint: %% row = rand(1,6); cell2mat( reshape( arrayfun( @(jj) row(jj)-row, (1:6), 'uni', false ), [],1 ) ) outputs ans = ...

Distance between all elements of row vector

Hint: %% row = rand(1,6); cell2mat( reshape( arrayfun( @(jj) row(jj)-row, (1:6), 'uni', false ), [],1 ) ) outputs ans = ...

2 days ago | 1

| accepted

Answered

Object oriented programming problem?

MyPr2.ap.datashare, is that a folder, ...\+MyPr2\+ap\+datashare, or a classdef-file, ...\+MyPr2\+ap\datashare.m ? Your code sni...

Object oriented programming problem?

MyPr2.ap.datashare, is that a folder, ...\+MyPr2\+ap\+datashare, or a classdef-file, ...\+MyPr2\+ap\datashare.m ? Your code sni...

4 days ago | 0

Answered

Converint between Cell arrays and Numbers and Strings

"cell array as shown" The screenshot doesn't show any cell array Another approach >> str = sprintf('%d', 10000111 ); >> n...

Converint between Cell arrays and Numbers and Strings

"cell array as shown" The screenshot doesn't show any cell array Another approach >> str = sprintf('%d', 10000111 ); >> n...

26 days ago | 1

Answered

Averaging and summing parts of a column based on date

Ten hours without an answer. Here is the result from my first experiment with timetable. See retime Resample or aggregate data ...

Averaging and summing parts of a column based on date

Ten hours without an answer. Here is the result from my first experiment with timetable. See retime Resample or aggregate data ...

26 days ago | 0

| accepted

Answered

How to properly overload horzcat and vertcat?

This looks more Matlabish, but whether it's better ... classdef myClass properties a@double b@double ...

How to properly overload horzcat and vertcat?

This looks more Matlabish, but whether it's better ... classdef myClass properties a@double b@double ...

26 days ago | 0

| accepted

Answered

SVD file to normal coordinates

Google found Advanced Signal Processing with Matlab Maybe Matlab functions comes with your instrument

SVD file to normal coordinates

Google found Advanced Signal Processing with Matlab Maybe Matlab functions comes with your instrument

27 days ago | 0

| accepted

Answered

Simple Questions, Please Answer 2

old is not the name of a Matlab function. Maybe you have a variable named old What does which old return?

Simple Questions, Please Answer 2

old is not the name of a Matlab function. Maybe you have a variable named old What does which old return?

27 days ago | 0

Answered

Simple Question, Please Answer

See colon, : Vector creation, array subscripting, and for-loop iteration and for for loop to repeat specified number of times

Simple Question, Please Answer

See colon, : Vector creation, array subscripting, and for-loop iteration and for for loop to repeat specified number of times

27 days ago | 0

| accepted

Solved

Max Change in Consecutive Elements

If an array is given as input then find the index of consecutive elements that represent maximum change. Example: Input ...

28 days ago

Solved

expand intervals

You're given a row vector of an even number of monotonically increasing integers. Each pair of consecutive integers is the lower...

28 days ago

Answered

Reading the exact time and date as in excel sheet !

"based on few examples discussed in the forum" The Matlab documentation is a much more reliable when it comes to the behavior o...

Reading the exact time and date as in excel sheet !

"based on few examples discussed in the forum" The Matlab documentation is a much more reliable when it comes to the behavior o...

28 days ago | 0

| accepted

Answered

Exporting a pre-allocated cell array to .csv files

I cannot guess what you tried and failed. However, study this example %% M961x1 = repmat( {magic(5)}, 3,1 ); % Small set of sa...

Exporting a pre-allocated cell array to .csv files

I cannot guess what you tried and failed. However, study this example %% M961x1 = repmat( {magic(5)}, 3,1 ); % Small set of sa...

29 days ago | 1

| accepted

Answered

Unable to perform assignment because the left and right sides have a different number of elements.

Maybe replace v(i+1)=v(i)+(g*m/c)*(1-exp(-c*t/m))); by v(i+1)=v(i)+(g*m/c)*(1-exp(-c*t(i)/m))); v(i+1) is a scalar, I assume...

Unable to perform assignment because the left and right sides have a different number of elements.

Maybe replace v(i+1)=v(i)+(g*m/c)*(1-exp(-c*t/m))); by v(i+1)=v(i)+(g*m/c)*(1-exp(-c*t(i)/m))); v(i+1) is a scalar, I assume...

1 month ago | 0

Answered

How to convert grade into letter grade

I guess this is what you intended function grade = letter_grade( n ) if n >= 91 grade='A'; elseif n >= 81 ...

How to convert grade into letter grade

I guess this is what you intended function grade = letter_grade( n ) if n >= 91 grade='A'; elseif n >= 81 ...

1 month ago | 1

| accepted

Answered

How can i find the column number in an array?

Try this M = rand( 6 ); % Sample data [~,ixc] = max(mean( M, 1 ));

How can i find the column number in an array?

Try this M = rand( 6 ); % Sample data [~,ixc] = max(mean( M, 1 ));

1 month ago | 0

Answered

Why is my function outputting a blank graph:

Replace plot(a,b) by plot(a,b,'d') and look up plot in the documentation

Why is my function outputting a blank graph:

Replace plot(a,b) by plot(a,b,'d') and look up plot in the documentation

1 month ago | 0

Answered

how to ask a for input, and keep asking the same question until the right input is inputted?

One way. n avoids running forever. %% n = 0; while n <= 12 n = n + 1; x = input('Please, input an even number ');...

how to ask a for input, and keep asking the same question until the right input is inputted?

One way. n avoids running forever. %% n = 0; while n <= 12 n = n + 1; x = input('Please, input an even number ');...

1 month ago | 1

| accepted

Answered

struct to cell array

Why? Because Matlab works that way. >> nums.f ans = 1 ans = 2 ans = 3 outputs a list and {} ...

struct to cell array

Why? Because Matlab works that way. >> nums.f ans = 1 ans = 2 ans = 3 outputs a list and {} ...

1 month ago | 0

| accepted

Answered

regexp problem in '.'

Try %% test='abcde.abcde'; regexp(test,'\.','split') returns ans = 1×2 cell array {'abcde'} {'abcde'} dot...

regexp problem in '.'

Try %% test='abcde.abcde'; regexp(test,'\.','split') returns ans = 1×2 cell array {'abcde'} {'abcde'} dot...

1 month ago | 0

| accepted

Answered

How can I use 'textscan' to read data from Sheet2 of an Excel file?

Try readtable( _______, 'DatetimeType', 'exceldatenum' ); See the documentation.

How can I use 'textscan' to read data from Sheet2 of an Excel file?

Try readtable( _______, 'DatetimeType', 'exceldatenum' ); See the documentation.

1 month ago | 1

| accepted

Answered

What is happening here?

Proposal: Set a breakpoint at the line that throws the error. Run the code again. At the breakpoint, inspect the values of the v...

What is happening here?

Proposal: Set a breakpoint at the line that throws the error. Run the code again. At the breakpoint, inspect the values of the v...

1 month ago | 0

Answered

How to select specific cells rows in a column

%% M = [ 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 ...

How to select specific cells rows in a column

%% M = [ 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 ...

2 months ago | 0

Answered

Cant find the number of row for big size of matrix

The editor warns you that there is an issue with your code. Notice the orange signs in the column to the right of the editor t...

Cant find the number of row for big size of matrix

The editor warns you that there is an issue with your code. Notice the orange signs in the column to the right of the editor t...

2 months ago | 2

| accepted

Answered

How do I exclude certain lines from data files?

I downloaded example750.csv and tried a different approach of extracting and converting the hex-values >> cssm( 'example750.csv...

How do I exclude certain lines from data files?

I downloaded example750.csv and tried a different approach of extracting and converting the hex-values >> cssm( 'example750.csv...

2 months ago | 0

Answered

getting error as "Data dimensions must agree." can someone help me resolve this

Are odefun1 and odefun the same function? Proposal: Set a breakpoint at the line that throws the error. Run the code again. At...

getting error as "Data dimensions must agree." can someone help me resolve this

Are odefun1 and odefun the same function? Proposal: Set a breakpoint at the line that throws the error. Run the code again. At...

2 months ago | 0