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

1 month 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 = ...

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

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

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

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

2 months 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

2 months 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?

2 months 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

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

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

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

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

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

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

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

2 months 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

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

2 months 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 {} ...

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

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

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

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

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

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

3 months ago | 0

Answered

Error: Index exceeds array bounds

There isn't enough information to spot with any certainty what the cause of the error is. The Matlab error message doesn't tel...

Error: Index exceeds array bounds

There isn't enough information to spot with any certainty what the cause of the error is. The Matlab error message doesn't tel...

3 months ago | 0

| accepted

Answered

Compare each row of matrix with the rest, conditionally

Assumptions: The lengths of the sides are whole numbers The maximum length of the sides is "reasonable" Another approach %%...

Compare each row of matrix with the rest, conditionally

Assumptions: The lengths of the sides are whole numbers The maximum length of the sides is "reasonable" Another approach %%...

3 months ago | 1

| accepted

Answered

Index exceeds matrix dimensions.

I've reproduced the error. The problem is that the variable, x, is empty when executions arrives at the line CTI1 = A(1,1)*x(1...

Index exceeds matrix dimensions.

I've reproduced the error. The problem is that the variable, x, is empty when executions arrives at the line CTI1 = A(1,1)*x(1...

3 months ago | 0

Answered

Why get message "The current directory 'c:\program files\matlab\r2017b\bin' is reserved for MATLAB files. Please change your current directory to a writeable directory outside of the MATLAB installation area" How to Resolve?

Use a different folder to which you have write permission. Make sure you have permission to write to your current folder.

Why get message "The current directory 'c:\program files\matlab\r2017b\bin' is reserved for MATLAB files. Please change your current directory to a writeable directory outside of the MATLAB installation area" How to Resolve?

Use a different folder to which you have write permission. Make sure you have permission to write to your current folder.

3 months ago | 0

| accepted