Community Profile # Rahul Kalampattel

Last seen: 1 year ago Active since 2013

#### Statistics

All
• • • • • • • • • #### Content Feed

View by

I am running a for loop for my program. however, I want to run the for loop until i have 10 non-zero values in the matrix A.
The simplest solution would be to change the |for| loop to a |while| loop. Just calculate |c| at each iteration, and once |c==10...

4 years ago | 0

how can i plot these dsp signals?
I think what you have is correct, except in the last command you should be plotting |q| rather than |S| and |x|. Also if you wan...

4 years ago | 0

How do i solve this problem?
The syntax for a user prompt is |prompt = 'text'| rather than what you had. prompt = 'Please enter number of strips: '; ...

4 years ago | 0

| accepted

Matlab simple loop for different function variables (Finite Difference)
Something like this? Or did you want all the error terms in one 3D matrix? clc clearvars close all hVec = [0.0...

4 years ago | 2

| accepted

How do I subtract from specific elements in a vector?
function [income cnt] = tickets( price, numTickets ) cnt = sum(numTickets); numTickets = numTickets - (numTickets>5)...

4 years ago | 0

| accepted

Problem plotting Möbius strip
Use |meshgrid| to generate matrices for both your parameters, rather than using vectors. u = linspace(0,2*pi,100); v =...

4 years ago | 2

| accepted

display surface normal using quiver3
*1.* Use [U,V,W] = surfnorm(X,Y,Z); instead of [U,V,W] = surfnorm(Z); This will make sure that the |quiver3| v...

4 years ago | 0

| accepted

Does anyone know why not all of my streamlines complete themselves?
If you check out the <http://au.mathworks.com/help/matlab/ref/streamline.html documentation> for the |streamline| function, you'...

4 years ago | 5

| accepted

Either quiver3 or streamline work for me, but not both, for the same test data

4 years ago | 1

| accepted

How to plot a bode graph
Have a look at the documentation for |<http://au.mathworks.com/help/matlab/ref/semilogx.html semilogx>| and see if it helps...

4 years ago | 0

What's wrong in this code? why is this not displaying whole matrix?and how to sum whole matrix?
You're overwriting the matrix |Cmd| every iteration because of the line |Cmd=zeros(M:D)|. Take it outside of both |for| loops. ...

4 years ago | 0

| accepted

Solving an equation on MATLAB
Can be solved using the symbolic toolbox, <https://au.mathworks.com/help/symbolic/solve.html>.

4 years ago | 0

| accepted

Executing the while loop
When I run your code, after the first iteration |err=0.028062920372021|. Since this doesn't satisfy the condition |err<=0.00001|...

4 years ago | 3

How to add values into Matlab matrix and not overwrite it
You're overwriting the contents of |B| twice in each iteration of your |for| loop: B = zeros(n,1); % preallocate, results ou...

4 years ago | 1

| accepted

How to have matrix values as a function of another variable
|h| and |u| are vectors since |t| is also a vector, hence why you get the error when trying to put them into the matrix |P|. ...

4 years ago | 0

| accepted

qickyly change 3D matrix to 2D matrix
For the example you gave, the following also works: a=squeeze(A(1,1,:));

4 years ago | 0

Bisection Method Piecewise function
The function you have declared is called |bisection|, not |bisectionF|. When you want to call or use this function, you need to ...

4 years ago | 0

how to use for loop
Type |help for| in your Matlab command window, or look at the relevant <http://au.mathworks.com/help/matlab/ref/for.html documen...

4 years ago | 0

Assign different input using for loop
I edited three lines (the commented out ones), the code now allows you to enter a row vector of inputs and returns a row vector ...

4 years ago | 0