Community Profile

# Ameer Hamza

### Hong Kong Polytechnic University

2.991 total contributions since 2016

3.1416

View all

Contributions in
View by

Shade the region to the left of the graph
Simplest way is to use patch(). Something like this %Stall Speed rho = 0.002378; % at sea level Clmax = 2.7; Vs = 189.056; ...

alrededor de 3 horas ago | 0

How to plot multiple graph
You are using the symbolic variables incorrectly. Check this code % clc; clear all; close all; syms x f(x)=sin(5*x)./(x.^3); ...

alrededor de 3 horas ago | 0

Reading single value from text file
Try this str = fileread('data.txt'); peak_freq = regexp(str, 'Peak frequency \(Hz\) =[\s\t]*(\d*\.\d*)', 'tokens'); peak_fr...

alrededor de 4 horas ago | 1

| accepted

vectorise for loop with element wise multiplication
Loops are not always necessarily slow. However, the vectorized code is much more cleaner and readable. For the simple example, y...

alrededor de 4 horas ago | 0

Matlab Newbie here / I want to multiselect files but it always gives me an error
When MultiSelect is on, then uigetfile() returns a cell array. So you need to specify which file to open in fopen like this fid...

alrededor de 4 horas ago | 1

How to convert my data from hourly to daily (no timestamp )
See retime(): https://www.mathworks.com/help/matlab/ref/timetable.retime.html But If you just want daily average, then you can...

alrededor de 4 horas ago | 0

How to get rid of values from meshgrid
Try this syms u uo ur v x y Q C r T tt V=100;b=2;uo=-V*sin(Q);ur=V*2*pi*b/(2.*pi.*r)+V*cos(Q);r=(x.^2+y.^2).^0.5;Q=atan2(y,x)...

alrededor de 4 horas ago | 0

| accepted

A loop to extract and plot data from a table
I think you meant x = 0:1:9 (10 rows). You can do something like this t % 10x11 table M = table2array(t); 10x11 matrix plot(...

alrededor de 5 horas ago | 0

How to compute integral when one of the limits is a vector
If you want to use all the points in x as the limits one after the other, then following is the way to do that FunctionToEvalua...

alrededor de 5 horas ago | 1

| accepted

Browse CSV file and calculate the mean

alrededor de 6 horas ago | 0

Make UIAxes Background invisible or hide it in APP Designer
It seems that the background color of a UIAxes cannot be set to 'none'. See the attached app for an alternative. It set the back...

alrededor de 6 horas ago | 0

| accepted

The function plotxy() is not recognized
You need simscape toolbox to use this function: https://www.mathworks.com/help/physmod/simscape/index.html. Also, you need to ca...

alrededor de 7 horas ago | 0

| accepted

fitting complex to custom complex equation
There are several ways to fit the given data to a custom model in MATLAB. If you have the curve fitting toolbox, then you can us...

alrededor de 8 horas ago | 0

How can i compute an interpolated curve?
Check this code % generating curves x = linspace(1, 2, 100); y1 = x.^3 + 2 + rand(size(x))*0.1; % let t=10 for this curve y2...

alrededor de 8 horas ago | 0

How to swap cells in matrix with code
Check this D = [8 1 6;3 5 7;4 9 2]; idx = find(D > 5); D(idx) = 0; Result >> D D = 0 1 0 3 5 0...

alrededor de 8 horas ago | 0

| accepted

Use PreserveVariableNames options ds = datastore('filename', 'PreserveVariableNames', true)

alrededor de 8 horas ago | 0

How accurately Simscape Multibody calculates volume of a complex custom cad file solid?
It appears that MATLAB documentation does not give details about the process of calculating these values from geometry. However,...

alrededor de 9 horas ago | 0

hi , i'm trying to make a simple loop which is give me a useless syntax between what i need , please how can i remove ('ans=') thanks anyway
Use fprintf() for k=1:20 fprintf('<div> DIV %d </div>\n',k) end

alrededor de 10 horas ago | 0

What is the problem in this following program? Why my function isn't working?
Define it like this function [area] = tri_area(b,h) area = (0.5)*(b)*(h); end Read about MATLAB functions here: https://www....

alrededor de 11 horas ago | 1

| accepted

draw a boxplot from percentiles
Something like this data = [702.454 1761.20017 1863.878989 2058.24099 5206.202; 662.9978 854.7328411 921.9074214 1079....

alrededor de 11 horas ago | 1

| accepted

Symbolic parameters not supported in nonpolynomial equations
This simply means that the equations are too complicated to be solved symbolically. Robot kinematic equations rarely have a clos...

alrededor de 11 horas ago | 0

How does the spring stiffness of the Revolute Joint in simscape defined?
It is defined here: https://www.mathworks.com/help/physmod/sm/ref/revolutejoint.html#bttq7al-2. It is the amount of torque requi...

alrededor de 12 horas ago | 0

You have used 'b' as a global variable. In the base workspace, you need to define it as an Arduino object b = arduino; If it h...

alrededor de 13 horas ago | 0

Calculating correlation matrix from time series in an array
Use corrcoef() but first convert the matrix to correct form C = % 164 elements cell array Cv = [C{:}]; % creating a matrix co...

alrededor de 15 horas ago | 0

Using LaTeX math in Simulink Block Name
The latex is only allowed in the annotations, not the block names. An alternate method is to create an annotation using latex an...

alrededor de 15 horas ago | 1

| accepted

Debugging Newton's Method code in two variables,
Check this code f = @(x) nonlinear_equations(x); % Jacobian J = @(x) [cos( x(2) ), -x(1)*sin(x(2)); x(2)*cos(x(1)), si...

alrededor de 15 horas ago | 0

| accepted

Error in ports width and dimension in simulink
Fuzzy logic controller block requires two inputs using a mux block, as shown in the example at the end of this page: https://www...

alrededor de 15 horas ago | 0

Can you help me 2-D graph as shown.
Something like this x1 = linspace(0, 1); y1 = -2*x1 + 2.5 + rand(size(x1))*0.05; y1(end) = y1(end-1)-1; x2 = linspace(0,...

alrededor de 16 horas ago | 0

| accepted