Community Profile

photo

Ameer Hamza


Last seen: Today

Hong Kong Polytechnic University

3,742 total contributions since 2016

3.1416

Contact

Ameer Hamza's Badges

  • MATLAB Central Treasure Hunt Finisher
  • Scavenger Finisher
  • Master
  • 6 Month Streak
  • Thankful Level 2
  • CUP Challenge Master
  • Promoter
  • Commenter
  • 5-Star Galaxy Level 2
  • Explorer
  • Personal Best Downloads Level 2
  • Editor's Pick
  • First Review
  • First Submission
  • Knowledgeable Level 4

View all

Contributions in
View by

Answered
(emd) How to get script/code from a figure/plot ?
In the figure window, go to File > Generate code. It will show the MATLAB code to generate such a figure.

9 hours ago | 0

Answered
Solve for exponent variable
You need to specify the assumption that . syms x y z a b c Q N P S assume(x, 'positive') Q = x^a S = simplify(solve(Q==(x^4)...

9 hours ago | 0

| accepted

Answered
How do I simulate a differential equation that has a squared derivative term in Simulink?
The block diagram seems correct. You can also use this block: https://www.mathworks.com/help/simulink/slref/mathfunction.html to...

10 hours ago | 1

| accepted

Answered
How can I find if there is at least one particular element in the string?
You can convert it to a string and then find how many contains a single 1 x = [1111,1112,1121,1211,2111,2112,2121,2211,2122,211...

12 hours ago | 0

Answered
Research randi, fix, round, ceil, floor functions. • Can you generate a random integer number without using randi?
All the answers can be found on following links https://www.mathworks.com/help/matlab/ref/randi.html https://www.mathworks.co...

13 hours ago | 0

Answered
How to get a plot?
You can use fplot() syms t v v = dsolve('D2v=-2*Dv-3*v+4*10*sin(5*pi*t)','v(0)=0','Dv(0)=0','t') fplot(v) Also, defining OD...

15 hours ago | 0

| accepted

Answered
fixed time step for ODE45
If you are only concerned about output at fixed time-step, then you can pass tspan as a vector of time-values tspan= tcon:0.01:...

15 hours ago | 0

Answered
convert each character of an array to int
Easy peasy x = '10000111101010110101'; y = x - '0'

15 hours ago | 1

| accepted

Answered
compare elements of a 2x1 column vector
You can directly make the comparison using the cell array c{1} = [1;0]; c{2} = [2;3]; comp_result = c{1}(1) > c{2}(2);

16 hours ago | 0

Answered
how to plot one variable against three variables ?
For solving for unknown variables, read about solve(). For plotting 3 variables against 1 variable, read about following functi...

17 hours ago | 0

Answered
How to set the length of axis in figures?
The lengths in cm are only relevant when you print the figure. If you just want to control the aspect ratio, then you can use pb...

18 hours ago | 0

Answered
array with vectors as elements
You need a cell array: https://www.mathworks.com/help/matlab/cell-arrays.html c = {} c{1} = [1; 0]; c{2} = [0; 1]; Access t...

18 hours ago | 0

| accepted

Answered
How to extract the correct phase of a sine wave from data
That is because you are doing a discrete Fourier transform. There can be a bit of spectral leakage to other frequency components...

19 hours ago | 0

Answered
Random Number Generation for Continuously Decrementing Range
Try this lb = 0; % initial upper bound ub = 1; % initial lower bound n = 10; % number of random point in each interval x =...

20 hours ago | 0

Answered
How to run an mlapp from a .m file
See run(): https://www.mathworks.com/help/matlab/ref/run.html run('powerSystemLineBusDiagram.mlapp')

20 hours ago | 0

Answered
Error in plotting (blank graph): Vector Size
Check the following code. You don't need to use eta(i+1). v = linspace(0,35,36); v = v * 0.44704; N = length(v); eta = zeros...

1 day ago | 0

Channel


My MW records

1 day ago

Answered
Error with solve function
You also need to define other variables as symbolic syms I1 I2 I3 R_s X_s X_m V1 X_r R_r Z1 eqn1 = I1*(R_s + X_s) + I3*X_m == ...

1 day ago | 0

Answered
how to get simscape electrical?
Simscape Electrical is a toolbox for Simulink. You can buy for your current license by going to your existing page or you can re...

1 day ago | 0

Answered
Matrix input/output to a Matlab function block in simulink
An alternate way is to create a parameter input in the MATLAB function block and give it the same name as the base workspace var...

1 day ago | 0

Answered
How to reduce precision of digit after decimal point? Matlab (R2020a)
If you are only concerned with displaying the results with two digits after the decimal, then you can use fprintf a = 334.65980...

1 day ago | 0

| accepted

Answered
Sort Cell Structure according to specific row
Are you tying to do something like this C; % 2xn cell array [~, idx] = sort([C{1,:}]); C = C(:, idx);

1 day ago | 0

| accepted

Answered
Finding Transfer Function from Step Response
Another approach can be something like this. Consider the transfer function of the system is and the transfer function of inp...

1 day ago | 0

Answered
Finding Transfer Function from Step Response
You can do it using the system identification app: https://www.mathworks.com/help/ident/ref/systemidentification-app.html. For t...

1 day ago | 0

| accepted

Answered
How to solve 3 interconnected equations?
If you have symbolic toolbox, you can use solve() syms M S R Rv = rand(10, 1); eq1 = M == S*3; eq2 = S == R+M; sol = so...

1 day ago | 0

Answered
How to put a preview figure window in a main figure window
You can create a second smaller axes x=0.01*rand(100,1); ax1 = axes(); [~,edges] = histcounts(log10(x)); histogram(x,10.^edg...

1 day ago | 0

| accepted

Answered
Reading the arranged file name
natsort() from FEX is exactly made for such cases: https://www.mathworks.com/matlabcentral/fileexchange/47434-natural-order-file...

1 day ago | 0

Answered
solve linear equation system with partially unknown coefficient matrix
One approach is to find a least square solution using fmincon() x = rand(4, 1); y = rand(4, 1); A = @(a) [a(1) a(2) 0 a(3);...

1 day ago | 0

Answered
3input vs 1 output Interpolation Problem
You need to use scatteredInterpolant() data = readtable('Data.xlsx'); idx = find(isnan(data.X), 1); data(idx:end, :) = []; ...

1 day ago | 0

| accepted

Answered
Undefined function or variable 'dumphex'.
dumphex is not a MATLAB's function. Some other similar functions are available on FEX: https://www.mathworks.com/matlabcentral/f...

2 days ago | 0

Load more