Community Profile

photo

Ameer Hamza


Last seen: Today

Hong Kong Polytechnic University

3,045 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

모두 보기

참여 게시물
보기 기준

답변 있음
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...

약 5시간 전 | 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...

약 5시간 전 | 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'); ...

약 5시간 전 | 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)

약 7시간 전 | 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...

약 7시간 전 | 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))

약 7시간 전 | 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(...

약 9시간 전 | 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...

약 9시간 전 | 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*...

약 9시간 전 | 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...

약 10시간 전 | 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.

약 10시간 전 | 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/...

약 10시간 전 | 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...

약 11시간 전 | 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...

약 11시간 전 | 1

답변 있음
Displays Nan in correlation result
r1 and r2 shoule be column vectors in your case rho= corr(r1(:),r2(:));

약 11시간 전 | 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...

약 11시간 전 | 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...

약 12시간 전 | 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...

약 13시간 전 | 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...

약 14시간 전 | 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...

약 14시간 전 | 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)...

약 15시간 전 | 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...

약 15시간 전 | 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

| 수락됨

답변 있음
sequence input layer - video classification
What about this example: https://www.mathworks.com/help/deeplearning/ug/classify-videos-using-deep-learning.html. This shows how...

1일 전 | 0

답변 있음
How to set window size for LSTM in Matlab?
You can use NumHiddenUnits option to specify the window size (if by window size, you mean the number of memory units). lstmLaye...

1일 전 | 0

답변 있음
Interpolate 2D-lookup table
Since your data is not available as meshgrid, you need to use scatteredInterpolant() % load [kg] m = [ 1800 2500 3200 390...

1일 전 | 1

Load more