Community Profile

photo

Ameer Hamza


Last seen: Today

Hong Kong Polytechnic University

3,048 2016 年以降の合計貢献数

3.1416

連絡する

Ameer Hamza's バッジ

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

すべて表示

貢献した分野
表示方法

回答済み
output visualisation in matlab code
An easy way is to add breakpoints to your code: https://www.mathworks.com/help/matlab/matlab_prog/set-breakpoints.html and then ...

約4時間 前 | 1

| 採用済み

回答済み
error in creating a vector the spans the length of another vector
Each row of M corresponds to one value in a a = [1 2 3 4 5]; M = arrayfun(@(x) linspace(0, 7/x, 20), a, 'uni', 0); M = vert...

約4時間 前 | 0

回答済み
Make NaN value part of matrix
Do something like this x_planes = [1 30 60]; % x-planes to keep M = % 60x60x60x80 matrix M_new = M*nan; M_new(x_planes, :, :...

約4時間 前 | 0

回答済み
Column Vector Containing the Row Sums of the Elements of A
Why not use the builtin function M = rand(10, 5); M_sum = sum(M, 2) As for your current code, the correct is function RowSum...

約16時間 前 | 0

| 採用済み

回答済み
trying to display a list of numbers
Why not primes(1000) https://www.mathworks.com/help/matlab/ref/primes.html or isprime(): https://www.mathworks.com/help/matl...

約16時間 前 | 0

| 採用済み

回答済み
how to plot 3D using a txt file
I assume that first 3 columns are x, y, and z values. You need to use scatteredInterpolant data = readmatrix('chalitp.txt'); ...

約17時間 前 | 1

| 採用済み

回答済み
I need help please, how can I write a program to count the number of digits of an integer the user entered ?
An alternative n = floor(log10(5984)+1)

約18時間 前 | 0

回答済み
getting an empty figure for line plot of sine function
Use element-wise division operator y = (sin(sin(pi*x))) ./ (pi*x); %^ use ./ instead of / Read here: http...

約18時間 前 | 0

回答済み
How to save figures from a loop to current folder with specific names
Write saveas() line like this saveas(h, sprintf('T%db%d.png',T_A, b_A))

約19時間 前 | 1

| 採用済み

回答済み
How do i get the values of a 2D matrix based on column indices ?
Use sub2ind() matrix = [1 2 3 4 5 6 7 8 9]; cols = [1 3 1]; idx = sub2ind(size(matrix), 1:size(...

約21時間 前 | 0

回答済み
What is the meaning of command for(x:x1:x2) ?
The correct is for i = x:x1:x2 % any variable name can be used in place of i % The variable i takes value from vector x:x1...

約21時間 前 | 0

回答済み
How can i connect these points that is basically act as transmitter and receiver. To connect one X with * individually
Something like this xx = 1000*rand(1, 100) - 500; yy = 1000*rand(1, 100) - 500; xr = xx + 30*rand(size(xx)); yr = yy + 30*...

約21時間 前 | 1

回答済み
simple way to multiply varying parameter with matrice
Try this A = rand(2,2); param = 0:0.1:2; M = arrayfun(@(x) {x*A}, param); M = blkdiag(M{:}); It multiplies A with all val...

約21時間 前 | 0

回答済み
'Array indices must be positive integers or logical values' error in my code
You missed multiplication operator (*) at several locations in the file test.m. Check the attached file and see the difference.

約22時間 前 | 0

回答済み
Use Simulink time variable in a Matlab Function
You can directly create MATLAB function inside Simulink using MATLAB function block: https://www.mathworks.com/help/simulink/ug/...

約22時間 前 | 0

| 採用済み

回答済み
Save a string consisting of data to another directory
See fprintf(): https://www.mathworks.com/help/matlab/ref/fprintf.html f = fopen('D:\Sim Results\filename.txt') fprintf(f, 'Po...

約22時間 前 | 0

| 採用済み

回答済み
Problems with formatting yticks
It seems that you have created the plot with categorical variables. Therefore, yticks must also be of categorical type. Change t...

約22時間 前 | 1

回答済み
Displays Nan in correlation result
r1 and r2 shoule be column vectors in your case rho= corr(r1(:),r2(:));

約22時間 前 | 0

回答済み
how to describe the nth term of convolution in matlab
See conv(): https://www.mathworks.com/help/matlab/ref/conv.html. You need to provide the complete array of u and v for convoluti...

約23時間 前 | 0

| 採用済み

回答済み
How to change date in a website page
It is not as simple as using strrep(). You need to be able to control webpages interactively. I don't think MATLAB has any usefu...

約23時間 前 | 0

| 採用済み

回答済み
Matlab function to read data files having .Cmn extension
Try the following code. It ignores the first two lines of the file and starts from the line MJdatet ... The first row is used...

1日 前 | 0

回答済み
Plotting a graph for a function with x <- seq(from=-2, to=2, len=10000) on the y axis and x on the x-axis
Something like this f = @(x) (sin(sin(x.^2))+cos(x/(1+x+2*x.^2))-11/10); x = linspace(-2, 2, 10000); plot(x, f(x)) yline(0...

1日 前 | 1

| 採用済み

回答済み
Is there a method for numerical integration with some symbolic variables?
Since a closed-form symbolic solution does not exist, you will need to use a numerical method. You cannot get a simple expressio...

1日 前 | 0

回答済み
Using fminbnd within arrayfun to perform elementwise optimization with additional parameters (nested anonymous functions?)
This is the correct way to do such a thing f = @(x, a, b) fun(x, a, b); opt = @(a, b, x1, x2) fminbnd(@(x) f(x, a, b), x1, x2)...

1日 前 | 0

回答済み
Save Variables declared in function to workplace.
It seems that you are dynamically naming the variables. This is not a recommended practice and should be avoided as much as poss...

1日 前 | 0

| 採用済み

回答済み
Numerical integration Matlab plot
You can do it using arrayfun (similar to for-loop, but compact) x1 = logspace(-9, -6, 10); fun = @(x) (1./(exp(0.00004781./(...

1日 前 | 0

| 採用済み

回答済み
Efficiently calculating sum-thresholds across vector
Try something like this rng(0); samples = rand(1, 1000); threshold = 10; samples_sum = cumsum(samples); idx = []; while ...

1日 前 | 0

回答済み
How to have qualitative expressions in 'x' axis plot in MATLAB?
Yes. Use XTickLabel property of the axes object. For example ax = axes(); plot(0:10, rand(1,11)); ax.XTick = [0 5 10]; ax.XT...

1日 前 | 0

回答済み
Getting shifted frequency curves instead of normal ones
The time vectors were stored in categorical datatype (bad choice). Therefore, you were getting that unexpected plots. Try the fo...

1日 前 | 0

回答済み
Do vector fields mapping R^2 to R^2 have to be coded in separate function files, or can I define anonymous functions for them directly in the script file?
Can MATLAB anonymous function return two outputs? Yes, for example >> f = @(x) deal(x, x^2); >> [a, b] = f(2) a = 2 b...

1日 前 | 1

| 採用済み

Load more