Answered

Uninterrupted segment length?

For a number that has longer digits, I am not sure. However, if it is within acceptable number of digits format long I...

Uninterrupted segment length?

For a number that has longer digits, I am not sure. However, if it is within acceptable number of digits format long I...

8 years ago | 0

| accepted

Answered

Hi I need help with this problem in MATLAB CODE!

Loop version: function Y = coffee(X) Y = zeros(length(X)-1,1); for i=1:(length(X)-1) if X(i+1) >= X(i) ...

Hi I need help with this problem in MATLAB CODE!

Loop version: function Y = coffee(X) Y = zeros(length(X)-1,1); for i=1:(length(X)-1) if X(i+1) >= X(i) ...

8 years ago | 1

| accepted

Question

Random Question: If MATLAB disappears tomorrow, what would be the immediate effect?

I had a heavy discussion with my colleague the other day about how our lives would change if MATLAB ceases to exist. Since we ar...

8 years ago | 0 answers | 0

Answered

How Can i sum same values in an arry untill it change to a diffrent number and sum these aswell

TeamPasses = [26 25 25 25 25 26 26 26 26 25 25 25 25 26 26 26 25 25 25 25 26 26 26 25 25 26 26 26 26 26]; coffee = find(di...

How Can i sum same values in an arry untill it change to a diffrent number and sum these aswell

TeamPasses = [26 25 25 25 25 26 26 26 26 25 25 25 25 26 26 26 25 25 25 25 26 26 26 25 25 26 26 26 26 26]; coffee = find(di...

8 years ago | 0

| accepted

Answered

Using an ELSEIF statement under another IF

Here is an example: input = input('Please insert an integer\n'); if input < 10 if input < 5 fprintf('You...

Using an ELSEIF statement under another IF

Here is an example: input = input('Please insert an integer\n'); if input < 10 if input < 5 fprintf('You...

8 years ago | 0

| accepted

Answered

How do I split double-digit elements in a vector into two separate elements?

Simple approach would be: v = [1 18 9 8]; for i = 1 : length(v) new_vec{i} = num2str(v(i)) - '0' end ...

How do I split double-digit elements in a vector into two separate elements?

Simple approach would be: v = [1 18 9 8]; for i = 1 : length(v) new_vec{i} = num2str(v(i)) - '0' end ...

8 years ago | 0

Answered

new to matlab simple question

Yes it will, assuming that you have previously defined the values for |a,b,c| obviously. If you write semicolon at the end of...

new to matlab simple question

Yes it will, assuming that you have previously defined the values for |a,b,c| obviously. If you write semicolon at the end of...

8 years ago | 0

| accepted

Answered

Help with my program in MATLAB CODE:

coffee = 0; while ~coffee G = input('Please insert the limit number that is greater than 4\n'); if G <= 4 coffee ...

Help with my program in MATLAB CODE:

coffee = 0; while ~coffee G = input('Please insert the limit number that is greater than 4\n'); if G <= 4 coffee ...

8 years ago | 0

| accepted

Answered

How can I repeat question until valid input is entered?

What if you implement it using a |while| loop? %Input clc; clear all; close all; fpc = input('Enter specified compressi...

How can I repeat question until valid input is entered?

What if you implement it using a |while| loop? %Input clc; clear all; close all; fpc = input('Enter specified compressi...

8 years ago | 1

| accepted

Question

Reading combinations of strings and numbers from a text file

I have a text file of a TLE as shown below. 1 24652U 96063A 96318.74847837 -.00000020 00000-0 00000+0 0 2 24652 ...

8 years ago | 1 answer | 0

Question

Generating a random number inside a function decleration

I am trying to solve a first order differential equation using |ode45|. My function declaration is as follows. function dx =...

8 years ago | 4 answers | 0

Answered

How to normalize data.

There are different methods you can use. One is the <http://www.mathworks.com/help/finance/tsmovavg.html moving average>. Howe...

How to normalize data.

There are different methods you can use. One is the <http://www.mathworks.com/help/finance/tsmovavg.html moving average>. Howe...

9 years ago | 0

Answered

How to plot the graph as function of three variables t=f(x,y,z)

You can use <http://www.mathworks.com/help/matlab/ref/mesh.html mesh> to plot the function. However, I need further details if i...

How to plot the graph as function of three variables t=f(x,y,z)

You can use <http://www.mathworks.com/help/matlab/ref/mesh.html mesh> to plot the function. However, I need further details if i...

9 years ago | 0

Answered

I need to add numbers in an array using a for loop...plz help

The problem with your code is |sum = sum + i|. Your |i| is defined as |i = 1:b = 1:length(A)|. You are summing the index numbers...

I need to add numbers in an array using a for loop...plz help

The problem with your code is |sum = sum + i|. Your |i| is defined as |i = 1:b = 1:length(A)|. You are summing the index numbers...

9 years ago | 1

Answered

deleting words from a cell array

x={'areach';'aread';'areal';'areality';'arean';'arear';'areasoner';'areaway';'areca';'arecaceae'}; for n = 1 : length(x) ...

deleting words from a cell array

x={'areach';'aread';'areal';'areality';'arean';'arear';'areasoner';'areaway';'areca';'arecaceae'}; for n = 1 : length(x) ...

9 years ago | 0

Answered

simulate dynamic response to a state space differential equation

How about defining your input like this. u = [t <= 1 & t >= 0; zeros(size(t));]; I also have few comments. * I don't ...

simulate dynamic response to a state space differential equation

How about defining your input like this. u = [t <= 1 & t >= 0; zeros(size(t));]; I also have few comments. * I don't ...

9 years ago | 0

| accepted

Question

Plotting a set of unit vectors in 2-D

I am trying to figure out what is the best way to plot a set of unit vectors in 2-D anchored at |(0,0)|. I am defining my rotati...

9 years ago | 1 answer | 0

Answered

Weird discrepancy while plotting solutions of ode systems

Without looking at the code, I don't think it is possible for us to answer your question. Judging from the graphs, I can onl...

Weird discrepancy while plotting solutions of ode systems

Without looking at the code, I don't think it is possible for us to answer your question. Judging from the graphs, I can onl...

9 years ago | 0

Question

Is there any way to import back figures that you initially exported from MATLAB?

I have used the "Copy Figure" on several plots I made on MATLAB and pasted it into Microsoft Word. I have accidentally deleted t...

9 years ago | 1 answer | 0

Question

Ignoring empty arrays when using arrayfun on a structure?

I have |1x2269| structure with 20 fields called |data|. I am trying to extract with a condition using |arrayfun|. west_eas...

9 years ago | 1 answer | 0

Answered

How to plot part of the data from larger data file?

A = rand(63, 5); sub_A = A(1:21, [1 2]); You can extract the 21 rows of the first two columns like this and proceed with...

How to plot part of the data from larger data file?

A = rand(63, 5); sub_A = A(1:21, [1 2]); You can extract the 21 rows of the first two columns like this and proceed with...

9 years ago | 0

| accepted

Question

Is it possible to combine two structures saved in two different .mat files?

I have two structures, both named 'data' with 17 same fields. They are basically measured data of two different dates, and I wou...

9 years ago | 1 answer | 0

Answered

Gradient of Substituted Symbolic Variables

It is because your function |f| is not updated. Here is what you need to do. syms x y z f = x^2 + x + y^2 - y; f = su...

Gradient of Substituted Symbolic Variables

It is because your function |f| is not updated. Here is what you need to do. syms x y z f = x^2 + x + y^2 - y; f = su...

9 years ago | 0

| accepted

Answered

Progress/percent complete bar

Take a look at the <http://www.mathworks.com/help/matlab/ref/waitbar.html |waitbar()|>. It displays a figure that shows what per...

Progress/percent complete bar

Take a look at the <http://www.mathworks.com/help/matlab/ref/waitbar.html |waitbar()|>. It displays a figure that shows what per...

9 years ago | 2

Answered

Find given element in column 1 with "find" function.

A = [ 1 1 3;1 2 3;1 2 1]; P = find(A(:,1)==1);

Find given element in column 1 with "find" function.

A = [ 1 1 3;1 2 3;1 2 1]; P = find(A(:,1)==1);

9 years ago | 0

| accepted

Answered

Matlab index (I tried to name a matrix to use in a loop like variables.)

You can use cell arrays to do the task. Simple example is, A{1} = [1 2; 3 4]; for j = 2 : 10; A{j} = A{j-1} * 2; ...

Matlab index (I tried to name a matrix to use in a loop like variables.)

You can use cell arrays to do the task. Simple example is, A{1} = [1 2; 3 4]; for j = 2 : 10; A{j} = A{j-1} * 2; ...

9 years ago | 0

Answered

Change Matrix dimension with NaN

One possible solution is to use <http://www.mathworks.com/matlabcentral/fileexchange/22909-padcat |padcat|> function from file e...

Change Matrix dimension with NaN

One possible solution is to use <http://www.mathworks.com/matlabcentral/fileexchange/22909-padcat |padcat|> function from file e...

9 years ago | 0

Answered

How can I convert a variable whose value is double to integer or to float?

z1 = rand(2601,1); int_z1 = int8(z1); I don't really understand what you mean by "float". Are you refering to single-pre...

How can I convert a variable whose value is double to integer or to float?

z1 = rand(2601,1); int_z1 = int8(z1); I don't really understand what you mean by "float". Are you refering to single-pre...

9 years ago | 0

| accepted

Answered

how to use matlab image in MS documents

Could you explain what you mean by image? If it is a simple figure (.fig), you can save it as a .JPG (.JPEG) format and insert t...

how to use matlab image in MS documents

Could you explain what you mean by image? If it is a simple figure (.fig), you can save it as a .JPG (.JPEG) format and insert t...

9 years ago | 0

Answered

How to delete workspace empty variables

a=who; for var=1:length(a) b=eval([a{var}]); if isempty(b) eval(['clear ' a{var} ';']) end en...

How to delete workspace empty variables

a=who; for var=1:length(a) b=eval([a{var}]); if isempty(b) eval(['clear ' a{var} ';']) end en...

9 years ago | 1