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

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

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

2 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', ...

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

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

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

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

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

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

2 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]; % ...

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

2 months ago | 1

Answered

use rgb to caculate three brown ratio

image = imread('sample.jpeg'); % Load the image image_double = im2double(image); % Convert to double precision floating point ...

use rgb to caculate three brown ratio

image = imread('sample.jpeg'); % Load the image image_double = im2double(image); % Convert to double precision floating point ...

2 months ago | 0

Answered

Estimate the psd of a signal

% Constants and Signal Definition Fs = 1000; % Sampling frequency in Hz duracion = 1; % Duration in seconds N = Fs * duracion...

Estimate the psd of a signal

% Constants and Signal Definition Fs = 1000; % Sampling frequency in Hz duracion = 1; % Duration in seconds N = Fs * duracion...

2 months ago | 0

| accepted

Answered

normal distributed numbers around a specific value

Using normrnd (if you have the Statistics and Machine Learning Toolbox) % Parameters mu = 50; % Mean (the specific value aroun...

normal distributed numbers around a specific value

Using normrnd (if you have the Statistics and Machine Learning Toolbox) % Parameters mu = 50; % Mean (the specific value aroun...

2 months ago | 0

| accepted

Answered

How can I analyze the sum and product together in a code?

An initial Idea: % Assuming the Excel file is named 'alpha_values.xlsx' and the values are in the first column alpha = xlsread...

How can I analyze the sum and product together in a code?

An initial Idea: % Assuming the Excel file is named 'alpha_values.xlsx' and the values are in the first column alpha = xlsread...

3 months ago | 0

Answered

How to multiply matrices randomly?

% Parameters d1 = 258e-9; % meters n1 = 1.45; d2 = 163e-9; % meters n2 = 2.3; totalLength = 200e-6; % meters layerCount = ...

How to multiply matrices randomly?

% Parameters d1 = 258e-9; % meters n1 = 1.45; d2 = 163e-9; % meters n2 = 2.3; totalLength = 200e-6; % meters layerCount = ...

3 months ago | 0

| accepted

Answered

Fourier Series Curve Fitting and giving its coefficient with respect to eqaution

An initial idea: % Corrected initialization of x and y arrays with multiline syntax x = [0.015404238, 0.027389034, 0.03937383,...

Fourier Series Curve Fitting and giving its coefficient with respect to eqaution

An initial idea: % Corrected initialization of x and y arrays with multiline syntax x = [0.015404238, 0.027389034, 0.03937383,...

3 months ago | 0

Answered

str2num sending figures to printer, is there an alternative?

% Example text line that might be read from your file textLine = 'The result is 42 and not 43.5 or any other number like -1.23e...

str2num sending figures to printer, is there an alternative?

% Example text line that might be read from your file textLine = 'The result is 42 and not 43.5 or any other number like -1.23e...

3 months ago | 0

Answered

index exceeds array bounds

load('data') % Assuming 'data' is your matrix % Find rows with any zero element rowsWithZero = any(data == 0, 2); % Remo...

index exceeds array bounds

load('data') % Assuming 'data' is your matrix % Find rows with any zero element rowsWithZero = any(data == 0, 2); % Remo...

3 months ago | 0

Answered

how can I plot

sigma_0 = 2; r = 1:0.1:2; % Range of r theta_deg = [0, 90, 180, 270]; % Angles in degrees theta_rad = deg2rad(theta_deg); % C...

how can I plot

sigma_0 = 2; r = 1:0.1:2; % Range of r theta_deg = [0, 90, 180, 270]; % Angles in degrees theta_rad = deg2rad(theta_deg); % C...

3 months ago | 0

Answered

How do I plot a function up to a certain value and start another function at that value for the same plot?

% Calculations for tilting ONLY AC = 2.125; Fc = 8130.0375; BD = 2; A = 0.03^2 * pi; % Varying angles a = 0:45; % Angle...

How do I plot a function up to a certain value and start another function at that value for the same plot?

% Calculations for tilting ONLY AC = 2.125; Fc = 8130.0375; BD = 2; A = 0.03^2 * pi; % Varying angles a = 0:45; % Angle...

3 months ago | 1

| accepted

Answered

How to replace elements in part of a matrix that meet a certain criteria?

% Assuming A is your sparse matrix and 'rows' is the 1D array of row indices you're interested in [rowIdx, colIdx, values] = fi...

How to replace elements in part of a matrix that meet a certain criteria?

% Assuming A is your sparse matrix and 'rows' is the 1D array of row indices you're interested in [rowIdx, colIdx, values] = fi...

3 months ago | 0

| accepted

Answered

for-loop from an if-statement

% Prompt the user to enter the number of grades N = input('Enter the number of grades you want to classify: '); % Initialize...

for-loop from an if-statement

% Prompt the user to enter the number of grades N = input('Enter the number of grades you want to classify: '); % Initialize...

3 months ago | 1

Answered

Plot the same data once normalized values on the left y-axis and once with units on the right ; the same for bottom and top x-axis

% Sample Data c = [2.88 1.27 100780000.00 44526000.00; 2.88 1.27 100860000.00 44561000.00; 2.89 1.28 100940000.00 44599000.00; ...

Plot the same data once normalized values on the left y-axis and once with units on the right ; the same for bottom and top x-axis

% Sample Data c = [2.88 1.27 100780000.00 44526000.00; 2.88 1.27 100860000.00 44561000.00; 2.89 1.28 100940000.00 44599000.00; ...

3 months ago | 0

Answered

If statements and strcmp function

angle = input('Enter an angle: '); units = input('Is it in degrees or radians? ', 's'); % Normalize the case of the user inp...

If statements and strcmp function

angle = input('Enter an angle: '); units = input('Is it in degrees or radians? ', 's'); % Normalize the case of the user inp...

3 months ago | 1

| accepted

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