Answered

Converting a cell array to can message timetable

Initial implementation: % Given cell array canMessageCell = {'Timestamp 1546909042', 'Interface ''can0''', 'ID ''0B9''', 'Data...

Converting a cell array to can message timetable

Initial implementation: % Given cell array canMessageCell = {'Timestamp 1546909042', 'Interface ''can0''', 'ID ''0B9''', 'Data...

4 months ago | 0

Answered

Matlab reading data using DLL and winsock2

Adjust as per your need: clc; clear; if libisloaded('udpfunc2') unloadlibrary('udpfunc2') end loadlibrary('udpfunc2.dl...

Matlab reading data using DLL and winsock2

Adjust as per your need: clc; clear; if libisloaded('udpfunc2') unloadlibrary('udpfunc2') end loadlibrary('udpfunc2.dl...

4 months ago | 0

Answered

How to recover the original signal using ifft

clear; clc; close all; % Time step dt = 2.5e-9; % Frequency of the sine wave f = 10e6; % Number of points in the orig...

How to recover the original signal using ifft

clear; clc; close all; % Time step dt = 2.5e-9; % Frequency of the sine wave f = 10e6; % Number of points in the orig...

4 months ago | 0

| accepted

Answered

Thingspeak HTTP eror code: -210

1. Check API Key and Channel ID Ensure that the API Key and Channel ID used in your HTTP request are correct. An incorrect API ...

Thingspeak HTTP eror code: -210

1. Check API Key and Channel ID Ensure that the API Key and Channel ID used in your HTTP request are correct. An incorrect API ...

4 months ago | 2

Answered

Why does the "Matrix dimensions must agree" error persists?

To give an initial idea: % Example MATLAB code to plot an audio recording % Sample rate Fs = 8000; % 8 kHz % Create a d...

Why does the "Matrix dimensions must agree" error persists?

To give an initial idea: % Example MATLAB code to plot an audio recording % Sample rate Fs = 8000; % 8 kHz % Create a d...

4 months ago | 0

Answered

How to add unknow parameter in matrix and solve it by use det() syntax for finding w

clc; % Clear command window clear; % Clear workspace syms w; % Define w as a symbolic variable % Define masses, damping coe...

How to add unknow parameter in matrix and solve it by use det() syntax for finding w

clc; % Clear command window clear; % Clear workspace syms w; % Define w as a symbolic variable % Define masses, damping coe...

4 months ago | 0

| accepted

Answered

Could not determine the size of this expression

Try this: function Yref = generateYref(n_y, Np, Rr, Vo_xy_ref) % Define the size of the output explicitly Yref = zero...

Could not determine the size of this expression

Try this: function Yref = generateYref(n_y, Np, Rr, Vo_xy_ref) % Define the size of the output explicitly Yref = zero...

4 months ago | 1

Answered

Measure concentration every 5 sec using Arduino

An initial idea: % Connect to Arduino a = arduino('COM3', 'Uno'); % Update 'COM3' with your actual COM port sensorPin = 'A0';...

Measure concentration every 5 sec using Arduino

An initial idea: % Connect to Arduino a = arduino('COM3', 'Uno'); % Update 'COM3' with your actual COM port sensorPin = 'A0';...

4 months ago | 0

| accepted

Answered

Python script changes are not updated in MATLAB

py.reload(py.matlab_file); Try using py.reload() -----------------------------------------------------------------------------...

Python script changes are not updated in MATLAB

py.reload(py.matlab_file); Try using py.reload() -----------------------------------------------------------------------------...

5 months ago | 0

Answered

Accessing a vector form a matrix

% Dummy data for vectors x1, x2, and x3 x1 = sin(linspace(0, 2*pi, 100)); % Example data for x1 (a sine wave) x2 = cos(linspa...

Accessing a vector form a matrix

% Dummy data for vectors x1, x2, and x3 x1 = sin(linspace(0, 2*pi, 100)); % Example data for x1 (a sine wave) x2 = cos(linspa...

5 months ago | 0

Answered

how to solve my problem that i write

clc; clear; close all; % Constants and parameters lambda_sh = 0.775e-6; % SH wavelength nlithium_sh = 2.1784; lambda_ff ...

how to solve my problem that i write

clc; clear; close all; % Constants and parameters lambda_sh = 0.775e-6; % SH wavelength nlithium_sh = 2.1784; lambda_ff ...

5 months ago | 0

Answered

Find the variable inside the LCM argument

% Known values of B and nrt B = 120; % Example value for B nrt = 8; % Example value for nrt % Find all divisors of B div...

Find the variable inside the LCM argument

% Known values of B and nrt B = 120; % Example value for B nrt = 8; % Example value for nrt % Find all divisors of B div...

5 months ago | 0

Answered

How to match matrix elements for a condition?

Assuming a 1-dimensional array. Will check for sums of three consecutive elements that are close to a given value (target_sum) w...

How to match matrix elements for a condition?

Assuming a 1-dimensional array. Will check for sums of three consecutive elements that are close to a given value (target_sum) w...

5 months ago | 1

Answered

using if else statements to assign a value to a variable based on the value of a specific element in a matrix

An initial idea: % Example matrix M M = randn(10,10); % A 10x10 matrix with random values % Initialize matrix p with the s...

using if else statements to assign a value to a variable based on the value of a specific element in a matrix

An initial idea: % Example matrix M M = randn(10,10); % A 10x10 matrix with random values % Initialize matrix p with the s...

5 months ago | 0

| accepted

Answered

How to draw a streamline diagram in a circular area？

% Parameters radius = 2; % Radius of the circular area x = linspace(-2.5, 2.5, 100); y = linspace(-2.5, 2.5, 100); [X, Y] = ...

How to draw a streamline diagram in a circular area？

% Parameters radius = 2; % Radius of the circular area x = linspace(-2.5, 2.5, 100); y = linspace(-2.5, 2.5, 100); [X, Y] = ...

5 months ago | 0

| accepted

Answered

Given the coordinates (x, y) of a center of a circle and it's radius, write a program which will determine whether a point lies inside the circle, on the circle or outside

% Define the coordinates of the center of the circle xc = 0; yc = 0; % Define the coordinates of the point to check xp = 3...

Given the coordinates (x, y) of a center of a circle and it's radius, write a program which will determine whether a point lies inside the circle, on the circle or outside

% Define the coordinates of the center of the circle xc = 0; yc = 0; % Define the coordinates of the point to check xp = 3...

5 months ago | 0

Answered

How can I illustrate a sinusoidal plane wave in MATLAB?

% Define the domain x = linspace(-2*pi, 2*pi, 100); z = linspace(-2, 2, 20); [X, Z] = meshgrid(x, z); % Define the wave y...

How can I illustrate a sinusoidal plane wave in MATLAB?

% Define the domain x = linspace(-2*pi, 2*pi, 100); z = linspace(-2, 2, 20); [X, Z] = meshgrid(x, z); % Define the wave y...

5 months ago | 1

Answered

Why is my code not working?

f = @(final) average_f(final) - 65; % Define a function that should be zero initial_estimate = 70; % Initial estimate for fso...

Why is my code not working?

f = @(final) average_f(final) - 65; % Define a function that should be zero initial_estimate = 70; % Initial estimate for fso...

5 months ago | 0

Answered

Find the number of regions and calculate the area of each region

clear; format short e; rng('shuffle'); %% Parameters export = 1; % Whether or not to save data for ABAQUS N = 1000; % nu...

Find the number of regions and calculate the area of each region

clear; format short e; rng('shuffle'); %% Parameters export = 1; % Whether or not to save data for ABAQUS N = 1000; % nu...

5 months ago | 0

Answered

How to append Nested cell array to .csv file

@Karthik One of many possible approaches: % Example nested cell array nestedCell = { {1, 2, 3}, 'Text'; 4, {5, 'More...

How to append Nested cell array to .csv file

@Karthik One of many possible approaches: % Example nested cell array nestedCell = { {1, 2, 3}, 'Text'; 4, {5, 'More...

5 months ago | 0

Answered

Why clearing memmapfile is taking too long?

function time = ReadDataStoreMapTime(filename) tic; chunksize = 2.5*1024*1024*1024; ds = fileDatastore(filename, ...

Why clearing memmapfile is taking too long?

function time = ReadDataStoreMapTime(filename) tic; chunksize = 2.5*1024*1024*1024; ds = fileDatastore(filename, ...

5 months ago | 0

Answered

Printing sentences using cell arrays

% Define cell arrays Names = {'Harry', 'Xavier', 'Sue'}; Verbs = {'loves', 'eats', 'throws'}; Nouns = {'baseballs', 'rocks', ...

Printing sentences using cell arrays

% Define cell arrays Names = {'Harry', 'Xavier', 'Sue'}; Verbs = {'loves', 'eats', 'throws'}; Nouns = {'baseballs', 'rocks', ...

5 months ago | 0

| accepted

Answered

can someone please assist to make the square wave plot at 50Hz

fs = 1000; % Sampling frequency f = 50; % Frequency of the square wave % Time vector from 0 to 1 second, with step size o...

can someone please assist to make the square wave plot at 50Hz

fs = 1000; % Sampling frequency f = 50; % Frequency of the square wave % Time vector from 0 to 1 second, with step size o...

5 months ago | 0

Answered

MATLAB 'imread' function error.

This problem can arise due to several reasons, including path conflicts, shadowing issues, or a corrupted MATLAB installation. H...

MATLAB 'imread' function error.

This problem can arise due to several reasons, including path conflicts, shadowing issues, or a corrupted MATLAB installation. H...

5 months ago | 0

| accepted

Answered

MATLAB coder has been running for a week

It is highly unusual for MATLAB Coder to take this long in the type inference stage. This extended processing time is not normal...

MATLAB coder has been running for a week

It is highly unusual for MATLAB Coder to take this long in the type inference stage. This extended processing time is not normal...

5 months ago | 0

| accepted

Answered

Combining multiple rows from one matrix to another matrix

% Define the original matrix P P = [1 2 3 4 5; 6 7 8 9 10; 11 12 13 14 15; 16 17 18 19 20; 21 22 23 24 ...

Combining multiple rows from one matrix to another matrix

% Define the original matrix P P = [1 2 3 4 5; 6 7 8 9 10; 11 12 13 14 15; 16 17 18 19 20; 21 22 23 24 ...

5 months ago | 0

Answered

plotting time as legend values with filter as x and amplitude as y

close all; clear all; clc; % Initialization fs = 20e3; % Sampling frequency numFilts = 32; % Number of filters CenterFre...

plotting time as legend values with filter as x and amplitude as y

close all; clear all; clc; % Initialization fs = 20e3; % Sampling frequency numFilts = 32; % Number of filters CenterFre...

5 months ago | 0

Answered

HTTP Request returns partial data

1. Server Closes Connection Prematurely The server might be closing the connection before all the intended data has been sent, ...

HTTP Request returns partial data

1. Server Closes Connection Prematurely The server might be closing the connection before all the intended data has been sent, ...

5 months ago | 0

Answered

Cone containing set of points

% Define the opening angle theta (in radians), and two points theta = pi / 6; % Example value for theta point1 = [1, 2, 3]; % ...

Cone containing set of points

% Define the opening angle theta (in radians), and two points theta = pi / 6; % Example value for theta point1 = [1, 2, 3]; % ...

5 months ago | 1

| accepted

Answered

Anybody can help me to plot a sand rose diagram?

% Your DP values for each of the 16 directional bins dp_values = [/* your DP values here */]; % Your RDD value rdd_value = ...

Anybody can help me to plot a sand rose diagram?

% Your DP values for each of the 16 directional bins dp_values = [/* your DP values here */]; % Your RDD value rdd_value = ...

5 months ago | 1