Answered

Why does the fft function cut in half the amplitude of my signal?

N = numel(data); freq = [0:N-1] / N * dq.Rate; X = fft(data); % Apply the window correction if you used a window function ...

Why does the fft function cut in half the amplitude of my signal?

N = numel(data); freq = [0:N-1] / N * dq.Rate; X = fft(data); % Apply the window correction if you used a window function ...

3 months ago | 2

Answered

graph the parametric surfaces

% Define the parametric surface function r(u,v) r = @(u,v) [u.*v, u.*v.^(-2); u.*v.^(-2), u.^(-2) - v.^(-2)]; % Define the r...

graph the parametric surfaces

% Define the parametric surface function r(u,v) r = @(u,v) [u.*v, u.*v.^(-2); u.*v.^(-2), u.^(-2) - v.^(-2)]; % Define the r...

3 months ago | 1

Answered

error in 3d plotting.

% Define the ODE function according to your problem statement. % It's important to ensure that this function correctly models t...

error in 3d plotting.

% Define the ODE function according to your problem statement. % It's important to ensure that this function correctly models t...

3 months ago | 0

| accepted

Answered

function calling in Matlab visualization in ThingSpeak

% Main script for MATLAB Visualization % This could be any code that reads and processes data from your ThingSpeak channel %...

function calling in Matlab visualization in ThingSpeak

% Main script for MATLAB Visualization % This could be any code that reads and processes data from your ThingSpeak channel %...

3 months ago | 1

| accepted

Answered

How can I replace data on the axis to become u horizontal and y vertical?

y = 0:0.01:5; t1=0.1; t2=3; t3=5; t4=10; nu = 5; u0=1; figure(1) hold on u1 = u0.*erfc(y./2.*sqrt(nu*t1)); u2 = u0.*erfc(...

How can I replace data on the axis to become u horizontal and y vertical?

y = 0:0.01:5; t1=0.1; t2=3; t3=5; t4=10; nu = 5; u0=1; figure(1) hold on u1 = u0.*erfc(y./2.*sqrt(nu*t1)); u2 = u0.*erfc(...

3 months ago | 0

Answered

Opening .m Files on Linux

1. Create a MATLAB .desktop File First, check if a MATLAB .desktop file already exists in /usr/share/applications/ or ~/.local/...

Opening .m Files on Linux

1. Create a MATLAB .desktop File First, check if a MATLAB .desktop file already exists in /usr/share/applications/ or ~/.local/...

3 months ago | 2

Answered

how can i find matrix spectral decomposition in matlab

If you can't get access to the Control System Toolbox, you can manually perform spectral decomposition for a 2x2 matrix like H =...

how can i find matrix spectral decomposition in matlab

If you can't get access to the Control System Toolbox, you can manually perform spectral decomposition for a 2x2 matrix like H =...

3 months ago | 0

| accepted

Answered

how can we do a fourier transform of continuos elliptical slip distribution?

% Define parameters Lx = 100; % Length of the fault in x-direction Nx = 512; % Number of points in x-direction A = 1; ...

how can we do a fourier transform of continuos elliptical slip distribution?

% Define parameters Lx = 100; % Length of the fault in x-direction Nx = 512; % Number of points in x-direction A = 1; ...

3 months ago | 0

Solved

Find the maximum number of decimal places in a set of numbers

Given a vector or matrix of values, calculate the maximum number of decimal places within the input. Trailing zeros do not count...

3 months ago

Answered

How to speed up pcolor and waterfall for large arrays?

Initial concept: originalData = rand(32000, 1000); % Example large dataset factor = 10; % Downsampling factor % Downsamplin...

How to speed up pcolor and waterfall for large arrays?

Initial concept: originalData = rand(32000, 1000); % Example large dataset factor = 10; % Downsampling factor % Downsamplin...

3 months ago | 0

Answered

I am trying to solve the following problem and got stuck if you can give some guidance

Looks like a MATLAB Cody Problem. One of the many approaches that may exist: x = [1.000 1.04 0.22 10.1; 2.05 2.33 4.1 1000.3...

I am trying to solve the following problem and got stuck if you can give some guidance

Looks like a MATLAB Cody Problem. One of the many approaches that may exist: x = [1.000 1.04 0.22 10.1; 2.05 2.33 4.1 1000.3...

3 months ago | 1

| accepted

Answered

what does eps(x) do ?

The function eps in MATLAB, which stands for epsilon, is used to determine the relative accuracy of the floating-point arithmeti...

what does eps(x) do ?

The function eps in MATLAB, which stands for epsilon, is used to determine the relative accuracy of the floating-point arithmeti...

3 months ago | 1

| accepted

Answered

Problem with Simscape Onramp

@Leo MathWorks Support Team(@MathWorks Support Team) will be able to help. Better to let them know. ---------------------------...

Problem with Simscape Onramp

@Leo MathWorks Support Team(@MathWorks Support Team) will be able to help. Better to let them know. ---------------------------...

3 months ago | 1

Answered

MATLAB does not run on new iMAC

@Solke Bruin Do a fresh install(re-install) of MATLAB. ------------------------------------------------------------------------...

MATLAB does not run on new iMAC

@Solke Bruin Do a fresh install(re-install) of MATLAB. ------------------------------------------------------------------------...

3 months ago | 0

Answered

why i got this error when i want to use GPU to accelerate the simulation?

Verify the MinGW version compatability with GPU Code Generation. --------------------------------------------------------------...

why i got this error when i want to use GPU to accelerate the simulation?

Verify the MinGW version compatability with GPU Code Generation. --------------------------------------------------------------...

3 months ago | 0

Answered

Index exceeds matrix dimensions.

clear; clc; close all; % Parameters numVehicles = 100; % Number of vehicles numEdges = 3; % Number...

Index exceeds matrix dimensions.

clear; clc; close all; % Parameters numVehicles = 100; % Number of vehicles numEdges = 3; % Number...

3 months ago | 0

| accepted

Answered

How does wblrnd generate random numbers?

rng(52); % Setting the seed for random number generation once for `a` a = zeros(1, 5); for i = 1:5 a(i) = wblrnd(4, 3); ...

How does wblrnd generate random numbers?

rng(52); % Setting the seed for random number generation once for `a` a = zeros(1, 5); for i = 1:5 a(i) = wblrnd(4, 3); ...

3 months ago | 0

Answered

how to generate random number

k = 3; randomNumbers = 1 + rand(1, k); % Generate k random numbers between 1 and 2 randomNumbersSorted = sort(randomNumbers);...

how to generate random number

k = 3; randomNumbers = 1 + rand(1, k); % Generate k random numbers between 1 and 2 randomNumbersSorted = sort(randomNumbers);...

4 months ago | 0

Answered

How to plot graph regarding the definite integral by using Midpoint rule for the function 𝑦 =x^1/3?

% Define the function to integrate using a function handle f = @(x) nthroot(x,3); % Define the interval and the number of s...

How to plot graph regarding the definite integral by using Midpoint rule for the function 𝑦 =x^1/3?

% Define the function to integrate using a function handle f = @(x) nthroot(x,3); % Define the interval and the number of s...

4 months ago | 1

| accepted

Answered

Use FunctionCaller and C-Caller together

Correct Prototype Matching: Ensure that the function prototype defined in the .h file matches the input and output specification...

Use FunctionCaller and C-Caller together

Correct Prototype Matching: Ensure that the function prototype defined in the .h file matches the input and output specification...

4 months ago | 0

Answered

Data and time dimensions are incompatible error message

Review Data Logging and Visualization Setup: Ensure that your model's data logging and visualization configurations are compatib...

Data and time dimensions are incompatible error message

Review Data Logging and Visualization Setup: Ensure that your model's data logging and visualization configurations are compatib...

4 months ago | 0

Answered

How do I implement a one-second buffer for incoming UDP data?

@Med Future Initial skeleton code. You may need to adjust as per your requirements. clear client_port = 10011; clientAddress ...

How do I implement a one-second buffer for incoming UDP data?

@Med Future Initial skeleton code. You may need to adjust as per your requirements. clear client_port = 10011; clientAddress ...

4 months ago | 0

Answered

How can I receive a cell array using a UDP port?

Sender client_port = 12389; clientAddress = '192.168.100.202'; % Define the cell array C = {5, "cereal", 110, "C+"; 12, "p...

How can I receive a cell array using a UDP port?

Sender client_port = 12389; clientAddress = '192.168.100.202'; % Define the cell array C = {5, "cereal", 110, "C+"; 12, "p...

4 months ago | 0

| accepted

Answered

Circular shifting or rotating structure of array elements

% Shift rows up by one position, making the third row the first A_shifted = circshift(A, -1); where A is your matrix/array. R...

Circular shifting or rotating structure of array elements

% Shift rows up by one position, making the third row the first A_shifted = circshift(A, -1); where A is your matrix/array. R...

4 months ago | 1

Answered

call Matlab code from c# / .NET threads: multi-thread scalability: is MathWorks.MATLAB.Engine best option?

MATLAB Engine API for .NET: MATLAB provides the Engine API for .NET, which allows you to call MATLAB from .NET applications. How...

call Matlab code from c# / .NET threads: multi-thread scalability: is MathWorks.MATLAB.Engine best option?

MATLAB Engine API for .NET: MATLAB provides the Engine API for .NET, which allows you to call MATLAB from .NET applications. How...

4 months ago | 1

| accepted

Answered

How to correctly store and access data in a 4D array?

It can be and other way could be: % Initialize a 4D array to store 2-by-2 matrices data = zeros(10,5,2,2); % Fill the array...

How to correctly store and access data in a 4D array?

It can be and other way could be: % Initialize a 4D array to store 2-by-2 matrices data = zeros(10,5,2,2); % Fill the array...

4 months ago | 0

Answered

integration in matlab plot

% Your desired values here x = [0, 0.5, 1.2, 1.4660, 2.9319, 4.3979, 5.8639, 7.3298, 8.7958, 10.2618, 11.7277, 13.1937, 14.6597...

integration in matlab plot

% Your desired values here x = [0, 0.5, 1.2, 1.4660, 2.9319, 4.3979, 5.8639, 7.3298, 8.7958, 10.2618, 11.7277, 13.1937, 14.6597...

4 months ago | 0

| accepted

Answered

trrapz function not working in matlab R2023b, how can I fix this?

clear clc close all table = readtable("B737lift_drag.xlsx"); x = table{:, 1}; % Convert table column to numeric array lift...

trrapz function not working in matlab R2023b, how can I fix this?

clear clc close all table = readtable("B737lift_drag.xlsx"); x = table{:, 1}; % Convert table column to numeric array lift...

4 months ago | 0

Answered

How can i encode strings in a array to numbers?

Using containers.Map % Assume 'matrix' is your string matrix uniqueCities = unique(matrix(:,9)); % Create a map object where ...

How can i encode strings in a array to numbers?

Using containers.Map % Assume 'matrix' is your string matrix uniqueCities = unique(matrix(:,9)); % Create a map object where ...

4 months ago | 0

| accepted

Answered

change the colors of legent in 2D-plot

@SIEF ADDEEN To what I understand your question: % Dummy data A = linspace(-15, 35, 100); % Common x-axis for Bs series A1 = ...

change the colors of legent in 2D-plot

@SIEF ADDEEN To what I understand your question: % Dummy data A = linspace(-15, 35, 100); % Common x-axis for Bs series A1 = ...

4 months ago | 0