I am an associate engineer in Engineering Development Group at Mathworks.

DISCLAIMER: Any advice or opinions here are on my own and in no way reflect that of Mathworks

Answered

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

LSc(j-1) = LSc(j)-h6*(auxLSc1+2*(auxLSc2+auxLSc3)+auxLSc4); In this line of your code , auxLSc2,auxLSc3,auLSc4 are arrays of s...

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

LSc(j-1) = LSc(j)-h6*(auxLSc1+2*(auxLSc2+auxLSc3)+auxLSc4); In this line of your code , auxLSc2,auxLSc3,auLSc4 are arrays of s...

1 hour ago | 0

Answered

How to solve for k in this model?

First solve the diffrerential equation and obtain function P as function of t and k using dsolve syms p(t) pm k lambda lambda...

How to solve for k in this model?

First solve the diffrerential equation and obtain function P as function of t and k using dsolve syms p(t) pm k lambda lambda...

1 day ago | 0

Answered

connecting switches to transformer

3 - phase transformer is a block from the Simscape Electrical Specialized Power Systems library whereas switch is a block in the...

connecting switches to transformer

3 - phase transformer is a block from the Simscape Electrical Specialized Power Systems library whereas switch is a block in the...

1 day ago | 0

Answered

How can I set pramaters of Simscape Solver Configuration block?

You can find the answer here

How can I set pramaters of Simscape Solver Configuration block?

You can find the answer here

2 days ago | 1

| accepted

Answered

Reverse 2D-lookup table: issues iterating through loops

In your code provided, size of array s is [1 301]. for j = 1:size(s)-1 % first element of the size array is considered I...

Reverse 2D-lookup table: issues iterating through loops

In your code provided, size of array s is [1 301]. for j = 1:size(s)-1 % first element of the size array is considered I...

2 days ago | 0

Answered

Why doesn't num2fixpt function return my expected counterpart fixed point value?

num2fixpt function does not convert double/float to a fixed point notation, instead it converts value to a nearest value represe...

Why doesn't num2fixpt function return my expected counterpart fixed point value?

num2fixpt function does not convert double/float to a fixed point notation, instead it converts value to a nearest value represe...

2 days ago | 0

Answered

Why the amplitude of the 90 shifted phase signal when use the analytic signal block is not equal to the original signal?

You can try variable phase shift block in simulink. https://www.mathworks.com/help/simrf/ug/variable-phase-shift.html

Why the amplitude of the 90 shifted phase signal when use the analytic signal block is not equal to the original signal?

You can try variable phase shift block in simulink. https://www.mathworks.com/help/simrf/ug/variable-phase-shift.html

23 days ago | 0

Answered

Send Email using gmail failed

You also have to set the preferences through GMAIL to allow interaction with MATLAB. You can do it with the following link: htt...

Send Email using gmail failed

You also have to set the preferences through GMAIL to allow interaction with MATLAB. You can do it with the following link: htt...

30 days ago | 0

Answered

Simulink error :Invalid setting of fixed step size

The error occurs because you have set the solver to fixed-step and specified the step size to be 0.001,which serves as the funda...

Simulink error :Invalid setting of fixed step size

The error occurs because you have set the solver to fixed-step and specified the step size to be 0.001,which serves as the funda...

1 month ago | 0

Answered

Zynq SDR Capture Length question!

You can just enable the property'EnableOversizeCapture' by setting it to true.In addition to the other arguments of capture func...

Zynq SDR Capture Length question!

You can just enable the property'EnableOversizeCapture' by setting it to true.In addition to the other arguments of capture func...

1 month ago | 0

| accepted

Answered

Substitute symbolic sub-expression in expression

Enclose the subexpresssion in braces as it contains more than one term. eq = Tnext - 2*Tn + Tprev == - (sigma*Tinf^4*h^2 + alph...

Substitute symbolic sub-expression in expression

Enclose the subexpresssion in braces as it contains more than one term. eq = Tnext - 2*Tn + Tprev == - (sigma*Tinf^4*h^2 + alph...

1 month ago | 0

| accepted

Answered

Conditional Indexing Using Specific Numbers in A Column

load('MyData.mat'); a=find(MyData(:,11)==5001); b=find(MyData(:,11)==6001); matrixA=MyData(a(1):b(end),:);

Conditional Indexing Using Specific Numbers in A Column

load('MyData.mat'); a=find(MyData(:,11)==5001); b=find(MyData(:,11)==6001); matrixA=MyData(a(1):b(end),:);

1 month ago | 0

Answered

Polyfit Vs Fit command: what are the differences?

Refer the below link to know the differences betwween fit and polyfit https://www.mathworks.com/matlabcentral/answers/81143-fit...

Polyfit Vs Fit command: what are the differences?

Refer the below link to know the differences betwween fit and polyfit https://www.mathworks.com/matlabcentral/answers/81143-fit...

1 month ago | 1

Answered

Problem in converting datetime to POSIX and then the same POSIX back to datetime

While converting the posixtime to datetime specify the TimeZone using name-value pair,If not specified the posix times are consi...

Problem in converting datetime to POSIX and then the same POSIX back to datetime

While converting the posixtime to datetime specify the TimeZone using name-value pair,If not specified the posix times are consi...

2 months ago | 0

| accepted

Answered

I need some Help coding a Database for Angles!

I have tried to understand what you want to achieved and tried to code it in a optimized way. for index = 1: 3 I = input ('E...

I need some Help coding a Database for Angles!

I have tried to understand what you want to achieved and tried to code it in a optimized way. for index = 1: 3 I = input ('E...

2 months ago | 0

Answered

How can I export data to excel from a GUI (created using GUIDE) using a push button

Create a cell array of all the variables and export the cell array to excel file which is created in the same directory using xl...

How can I export data to excel from a GUI (created using GUIDE) using a push button

Create a cell array of all the variables and export the cell array to excel file which is created in the same directory using xl...

2 months ago | 0

Answered

Selection data from Discrete Root Mean Square simulink

As you specified that your Discrete RMS Value block generates output [0;1.0977] ,make sure you set the Input port size of the se...

Selection data from Discrete Root Mean Square simulink

As you specified that your Discrete RMS Value block generates output [0;1.0977] ,make sure you set the Input port size of the se...

2 months ago | 0

| accepted

Answered

how do i calculate the partial sum of a fourier series?

There is not direct built-in function yet to do that .You can do that by your own code.Try the script below with your function ...

how do i calculate the partial sum of a fourier series?

There is not direct built-in function yet to do that .You can do that by your own code.Try the script below with your function ...

2 months ago | 0

Answered

How to change the color of uitable 'row-wise'?

You can make use of uistyle and addstyle functions Refer to the documnetation link below https://www.mathworks.com/help/matlab...

How to change the color of uitable 'row-wise'?

You can make use of uistyle and addstyle functions Refer to the documnetation link below https://www.mathworks.com/help/matlab...

2 months ago | 0

Answered

Matlab error in simulink for numerator of transfer function 'Unable to use a value of type tf as an index'

Here variable s represents the transfer function and cannot be used as an index to access the elements of the arrays num_th_Case...

Matlab error in simulink for numerator of transfer function 'Unable to use a value of type tf as an index'

Here variable s represents the transfer function and cannot be used as an index to access the elements of the arrays num_th_Case...

2 months ago | 0

| accepted

Answered

[ empty sym ] & "unable to find explicit solution" error when using dsolve for second order differential equation

syms y(t) [v] = odeToVectorField(diff(y,t,2)+0.15*diff(y,t)+y-y^3 == 0); M = matlabFunction(v,'vars', {'t','Y'}); t= [0 20];...

[ empty sym ] & "unable to find explicit solution" error when using dsolve for second order differential equation

syms y(t) [v] = odeToVectorField(diff(y,t,2)+0.15*diff(y,t)+y-y^3 == 0); M = matlabFunction(v,'vars', {'t','Y'}); t= [0 20];...

3 months ago | 0

Answered

How can I make a symbolic function with vector input?

a=sym('a',[1 3]); f= @(a)(a(1)^2+a(2)+a(3)*a(1)); k=[1 1 1]; f(k)

How can I make a symbolic function with vector input?

a=sym('a',[1 3]); f= @(a)(a(1)^2+a(2)+a(3)*a(1)); k=[1 1 1]; f(k)

3 months ago | 0

| accepted

Answered

Merging multiple .txt files into one NetCDF file

First,you can read the text files into tables of data using readtable. Merge the data of the 37 tables to a single table.Convert...

Merging multiple .txt files into one NetCDF file

First,you can read the text files into tables of data using readtable. Merge the data of the 37 tables to a single table.Convert...

3 months ago | 0

| accepted

Answered

Converting 2D plots into a 3D plot

As you have 3 vectors waterdepth,time and velocities, you can plot a 3D scatter plot by making use of scatter3 function. Refer ...

Converting 2D plots into a 3D plot

As you have 3 vectors waterdepth,time and velocities, you can plot a 3D scatter plot by making use of scatter3 function. Refer ...

3 months ago | 0

Answered

How do i make this function write to the ode

Here,you are not passing a valid input to the choice function.Pass the output from the menu function,the number of the chosen it...

How do i make this function write to the ode

Here,you are not passing a valid input to the choice function.Pass the output from the menu function,the number of the chosen it...

3 months ago | 0

| accepted

Answered

To Workspace Simulink Block returns structure

There exists a property 'Save format' of the 'To Workspace' block for saving the simulation output to the MATLAB workspace in a ...

To Workspace Simulink Block returns structure

There exists a property 'Save format' of the 'To Workspace' block for saving the simulation output to the MATLAB workspace in a ...

3 months ago | 0

Answered

Updating line connection in Simulink

You can do that by deleting the lines connected from Block_A to Block_B and Block_A to Block_C.Add a new block Block_X.Then a...

Updating line connection in Simulink

You can do that by deleting the lines connected from Block_A to Block_B and Block_A to Block_C.Add a new block Block_X.Then a...

3 months ago | 0

Answered

How to convert GPS data (lon,lat) data into position in x and y plane

grn2eqa function converts GPS data of latitudes and longitudes to coordinates in x-y plane . Refer to the below link to know mo...

How to convert GPS data (lon,lat) data into position in x and y plane

grn2eqa function converts GPS data of latitudes and longitudes to coordinates in x-y plane . Refer to the below link to know mo...

3 months ago | 1

Answered

Running a simulink file at File Exchange

You can download the zipped file folder from the Downloads button at the top-right (shown in the attached figure) . Extract the ...

Running a simulink file at File Exchange

You can download the zipped file folder from the Downloads button at the top-right (shown in the attached figure) . Extract the ...

3 months ago | 0

| accepted