Answered
how to simulate air conditioning compressor using simulink ?
Here are a few points how to start on this exercise. (1) MATLAB/Simulink has a nice builtin simulation model example: https:/...

3 years ago | 0

Answered
plotting data from multiple sheets by ID and day
Here is the complete solution code: FName = 'RLC_AD.xlsx'; for jj=1:numel(sheetnames(FName)) RLCAD = readmatrix(FName, 'Sheet...

3 years ago | 0

Answered
Removing numerical data from txt file
Here is the solution: unzip('https://www.mathworks.com/matlabcentral/answers/uploaded_files/1300600/CONTROLDS2247_SGI_PPCS_Bat...

3 years ago | 0

Answered
why is my plot blank?
It looks like that the whole imported data is not taken for x and y to plot them. See - e.g.: D = readtable('DATA_A.csv'); x =...

3 years ago | 0

Answered
How introduce column vector in M-file?
Here is the corrected code: D = 15; tmpI = eye(D); ket = sum(tmpI(:,2:D),2); syms n ct = 6; creation = circshift(diag(sqrt...

3 years ago | 0

| accepted

Answered
Collection of Squares RGB Matrix
If understood correctly, here is one example: M = uint8(ones(10)); R = [255*M M M 255*M M; M 255*M M M 255*M; M M ...

3 years ago | 0

Answered
Finding Limits of Two variables
Here is a small example: syms x y f(x, y) f(x, y) = 2*x^2 + y^3; XLIM = limit(f(x,y), x, sqrt(Inf)) YLIM = limit(f(x,y), y, ...

3 years ago | 0

Answered
I don't know why I can't open a text file?
(1) Do you have your downloaded file (age.txt) in your MATLAB's current directory OR (2) Did you show the directory address wh...

3 years ago | 0

Answered
Find the unique arrays in a list of arrays
One of the viable fcns to use here is isequal(), e.g.: A = [0 1 1;1 1 1]; B = [1 1 1;0 0 1]; C = [0 1 1;1 1 1]; ALL{1} = A; ...

3 years ago | 0

Answered
problem on saving within a folder of the figures I'm going to generate
Try exportgraphics() to save the image graphics

3 years ago | 0

Answered
time-frequency analysis of multi-component chirp
Here are the frequency and the time-frequency analyses of the Chirp signal: Fs = 1000; L = 2000; T = 1/Fs; t = (0:L-1)*T; ...

3 years ago | 0

| accepted

Answered
How to improve a simple code so it takes and calculates several resistance values as shown in table?
Here is the completed code with the for .. end loop: t = linspace(0, 0.1, 1000); R = [1 100 300 560 1000]; R_L = 1E+5; c = 1...

3 years ago | 1

| accepted

Answered
if-else if inside the for loop
Here is how to do it in for .. end loop N = 1:24; for ii=1:length(N); if ismember(ii, [1,2,4,5,6,13,14,16,17,18]) ...

3 years ago | 0

| accepted

Answered
two x-axis plot
Here is a corrected code: x1 = [500 850 1200]; x2 = [0.1 0.2 0.3]; t = tiledlayout(1,1); ax1 = axes(t); hAx(1)=gca; hAx(...

3 years ago | 0

Answered
remesh code for a 3D geometry
An alternative mesh fcn in MATLAB is ndgrid() - see this example: xx = linspace(-pi,pi, 20); [X,Y] = ndgrid(xx); Z = 2*X.*exp...

3 years ago | 0

Answered
remesh code for a 3D geometry
It is worth testing these fcns for remeshing: griddata() griddatan() delaunayn()

3 years ago | 0

Answered
how to use fft to plot the average values and their standard deviations in the frequency domain?
First of all, both signals need to be in one domain. If the freq domain is chosen then both need to be in the freq domain. In...

3 years ago | 0

| accepted

Answered
how to plot a signal in the time domain?
This issue is related to the order of the data series that can be solved using sort() fcn. See this example: x = [7 -1 3 ...

3 years ago | 0

| accepted

Answered
Figure legend mismatch when using gobjects
Try this syntax: figure; GObjects = gobjects(18,1); L = {"r bound","m bound","ns bound","r elong","m elong","free"}; color...

3 years ago | 0

Answered
Using a column of cells as variable names in a table
Here is how to get this assignment done: T = readtable('Properties.xlsx'); T2 = table(T.Var2, 'RowNames',T.Var1) T2 = rows2va...

3 years ago | 2

Answered
Removing numerical data from txt file
Here is one of the possible solutions for this exercise regexprep(): Text=readlines('Citation.txt') % Read data file with text...

3 years ago | 0

Answered
using scope in Matlab Simulink to display when input's value changes
It is a very intersting exercise. There are a few different ways to get simulation results for different values of a as defined ...

3 years ago | 1

Answered
fill in the area in plot
Use patch(). How far it is different from your previous post: https://www.mathworks.com/matlabcentral/answers/1914560-how-to-...

3 years ago | 0

Answered
Time-frequency analysis using spectogram
There are a couple of inconsistencies (fs value was incorrect and not read from the signal27.mat) in the code. Here is the corre...

3 years ago | 0

| accepted

Answered
How to convert a uint8 image to complex double?
One of the dimensions can be removed using squeeze() fcn or taking averaged pixel values from R, G, B layers: D = imread('01.pn...

3 years ago | 0

| accepted

Answered
Accurate measurement of inverter and motor efficiency
One quick note is the equations and conversions. It looks like there is a "pi" magnitude problem in your calculations of power. ...

3 years ago | 0

Answered
how to put date and time (exple 02-17-2023 06:05:34) on the x axis of a 3D plot
Use readtable while importing your data into matlab and plot - see this example: Data= readtable('DATA_Ts.csv', 'Format','%s%{d...

3 years ago | 1

Answered
Chebyshev type 2 filter comparison on bode plot
Here is how it can be achieved - see the last figure. The fcn linkaxes() is needed. fc = 1000; fs = 8000; [b1,a1] = cheby2(1,...

3 years ago | 0

| accepted

Answered
how to modify a plot
This is how it can be attained: clear all W=45000; S=9; b=7.5; clmax=2; clmin=-1; nmax=4; AR=7; nmin=-3; clalpha = 2*p...

3 years ago | 1

Answered
plot a graph from loop
One of the possible ways to plot nv vs, V is to include cl values that leads to 3D plot, e.g.: ... alpha = 1:0.25:12; nv=nmin...

3 years ago | 0

Load more