Answered
How can I get a bode magnitude to be a certain size vector?
The bode function allows you to specify a vector of frequencies in radians/time_unit.. See the documentation section on Bode Pl...

4 years ago | 0

| accepted

Answered
How can I compute envelope for three phase current?
I am not certain what you want. Perhaps this — Fs = 0.0001; t = linspace(0, 1, 1/Fs)/Fs; s = sin(2*pi*t*60 + deg2rad([0; ...

4 years ago | 1

| accepted

Answered
how can i save my values of u into a vector, so i have the result of all the u-values.
The loop is not necessary. Just use matrix multiplication. One approach — x=(0:0.1:1).'; ...

4 years ago | 1

| accepted

Answered
find fitting equation and parameters to fit damped oscillations curves from set of data
I can approximate the fit, however not to the oscillations. The best model is a mathematical model of the process that create...

4 years ago | 0

| accepted

Answered
Solve system of equations
Solve the first equation for and then plot both of them as functions of using the hold function.

4 years ago | 0

Answered
Best Fit Line for Parabola
Try something like this — x = [0; 0.019; 0.036]; y = [0.015; 0.25; 0.05]; p = polyfit(x, y, 2) xv = linspace(min(x), max(x)...

4 years ago | 0

Answered
vpasolve accuracy in two equations with two variables
I am not certain what problem you are having. One option is to solve the equations and then use vpa on the solutions. Exam...

4 years ago | 0

| accepted

Answered
How to find the maximum value by comparing 2 cells?
This is not as efficient as I would like it to be, however it works — A = {2,4,5}; B = {1,10}; MaxC = max(cellfun(@(x)max([x...

4 years ago | 0

| accepted

Answered
Finite Impulse Response filter
I thought about doing this with an optimisation funciton, however it minimises the distance between the estimated transfer funct...

4 years ago | 0

Answered
FIR_Filter Kaiser
I am not certain what the problem is. Try something like this — fsamp = 12000; %sampling rate fcuts = [1800 2000]; %indic...

4 years ago | 0

| accepted

Answered
How to find monthly average from daily data?
You will need to combine the year, month, and day into one datetime array, and then replace the individual variables with the da...

4 years ago | 0

| accepted

Answered
When calling a user defined function, MATLAB throws an error for simple matrix multiplication
It is best to not use global variables. The problem is that they have to be defined in the calling routine as well as the funct...

4 years ago | 1

| accepted

Answered
How can I get txtscan to read this file?
It would help to have the file to experiment with. If textscan is only reaidng the first line, consider adding: 'EndOfLine'...

4 years ago | 0

| accepted

Answered
Can't generate histfit subplot (error using histfit, subscripting into a table)
The error is in the histfit code at line 69. That reference has nothing to do with your code or data. The problem is likely ...

4 years ago | 0

| accepted

Answered
Relative occurance of intersect values
The intersect funciton can output the indices of the intersecting elements. See Intersection of Two Vectors and Their Indices f...

4 years ago | 0

| accepted

Answered
how can I find the intersection of two surface
MATLAB is case-sensitive so ‘ct’ ~= ‘Ct’ (and so for the others) in the ‘cdot’ and ‘ctdot’ calls. I would like to run this to...

4 years ago | 0

| accepted

Answered
how to calculate the power of 2 in a symbolic expression?
Try something like this — syms s1 s2 s3 v = 3*sqrt(5)*s1 + 27*sqrt(34)*s2 + 15*sqrt(629)*s3/17 + 3 v2 = 2^v v2 = vpa(v2, 6...

4 years ago | 0

| accepted

Answered
Issue with sgtitle and subplots. and question about applying a gradient hue to a lineplot
It may be cut off because of the limits on the figure 'Position' or 'OuterPosition' property. See if something like: Fig = ...

4 years ago | 0

| accepted

Answered
How to apply a relational operator on a cell in MATLAB?
Use the cellfun and nnz functions — B = num2cell(rand(41)); A = nnz(cellfun(@(x)x<0.0038, B)) .

4 years ago | 0

| accepted

Answered
If I try to use `sprintf` to format a string as numeric, why does a different number get passed?
Using: C='10'; ‘C’ is a character array, not actually a number. The conversion to double results in the ASCII codes for the ...

4 years ago | 0

Answered
Rotating X & Y Data
See if the rotate function will work.

4 years ago | 1

| accepted

Answered
Adding parameter to file name string when saving a figure using savefig or figsave
I am not certain what you want. Perhaps — CHANNEL=1; dt = datestr(now,'yymmdd_HHMMSS'); filename = sprintf("C15_rhs_CalAD...

4 years ago | 1

| accepted

Answered
Formatting of result values.
That is not a format MATLAB will do automatically. I wrote a utility function for my own use for such requirements — x=0.00...

4 years ago | 0

| accepted

Answered
Plot - representation of frequency to time dependece
I would use the pspectrum function with the 'spectrogram' option. (The spectrogram function is also an option,. however the uni...

4 years ago | 1

| accepted

Answered
How to smooth and normalize noisy data
I have no idea what result you want. One option is the filloutliers function (or similar functions) and another is the Signal...

4 years ago | 0

| accepted

Answered
How to Solve recurrence equation
Try something like this — h(1) = rand; % Initial Condition h(2) = rand; ...

4 years ago | 0

| accepted

Answered
Convert matrix into CSV, with each matrix element as a separate line including indices of matrix element
Try something like this — M = [0.5 0.1 0.6 0.9 0.8 0.3]; [r,c] = ndgrid(1:size(M,1), 1:size(M,2)); rv = reshape(r.',[]...

4 years ago | 0

| accepted

Answered
How to find second intersection point?
It is easiest to do this symbolically — syms x f1 = 1/x; f2 = sqrt(5./2 - (x^2)); Intx = solve(f1 == f2) Intxd = double(I...

4 years ago | 0

Answered
Error using convert2quaterly: The value of 'TT1' is invalid.
The table argument has to be a timetable, so it must be converted after creating an appropriate datetime array for ‘date’. T ...

4 years ago | 0

| accepted

Answered
How to plot and filter some values from a csv file?
Use the rmoutliers function to remove the outliers. The easiest way to implement a polynomial fit to data like these is with ...

4 years ago | 0

| accepted

Load more