Answered

Error Using ^ When Typing Power Command

Let's say for example you have the vector: t = 1 : 10; This is basically a 1-by-10 matrix. So, t^2 tries to perf...

Error Using ^ When Typing Power Command

Let's say for example you have the vector: t = 1 : 10; This is basically a 1-by-10 matrix. So, t^2 tries to perf...

nästan 5 år ago | 1

| accepted

Answered

Read data file with mixed delimited columns

Please try the attached code. It's not elegant but it does what you want.

Read data file with mixed delimited columns

Please try the attached code. It's not elegant but it does what you want.

nästan 5 år ago | 0

| accepted

Answered

How to make an interactive drop down in App Designer?

Add a 'DropDownValueChanged' callback to your uidropdown;

How to make an interactive drop down in App Designer?

Add a 'DropDownValueChanged' callback to your uidropdown;

nästan 5 år ago | 0

| accepted

Answered

sum of array in structure.

try this. uC = arrayfun(@(v) sum(v.Y),x)

sum of array in structure.

try this. uC = arrayfun(@(v) sum(v.Y),x)

nästan 5 år ago | 0

| accepted

Answered

Scan and change a specific number in a text file?

How about this: filename = 'Item.txt'; % Read the text from file filetext = fileread(filename); % Set the search p...

Scan and change a specific number in a text file?

How about this: filename = 'Item.txt'; % Read the text from file filetext = fileread(filename); % Set the search p...

mer än 5 år ago | 0

| accepted

Answered

Hallo, i have my matlab exam tomorrow, can anyone help me find the errors in the give Parameter. Thankyou

The error is in the line y=pi+v(3) You are essentially trying to retrieve the 3rd element of a 2-element array/vector. ...

Hallo, i have my matlab exam tomorrow, can anyone help me find the errors in the give Parameter. Thankyou

The error is in the line y=pi+v(3) You are essentially trying to retrieve the 3rd element of a 2-element array/vector. ...

mer än 5 år ago | 0

Answered

How to create vectors in the for loop

Try this. B = arrayfun(@(x) linspace(-x,x,47),A,'uni',false); % B is a cell array of vectors Using a for loop: len ...

How to create vectors in the for loop

Try this. B = arrayfun(@(x) linspace(-x,x,47),A,'uni',false); % B is a cell array of vectors Using a for loop: len ...

mer än 5 år ago | 1

| accepted

Answered

How to store two tables resulting from a for loop

Ok, I now understand what you want. numIters = 3; tables = cell(numIters,1); % A cell array to store the tables for...

How to store two tables resulting from a for loop

Ok, I now understand what you want. numIters = 3; tables = cell(numIters,1); % A cell array to store the tables for...

mer än 5 år ago | 3

Answered

Change meshgrid axes min/step/max value using a GUI

Does this help: assignin('base','minX',eval(minX)); % minX is the text such as '2:3:18'

Change meshgrid axes min/step/max value using a GUI

Does this help: assignin('base','minX',eval(minX)); % minX is the text such as '2:3:18'

mer än 5 år ago | 0

Answered

How to make mesh or contour by using just x,y,z coordinates data ?

[xx,yy,zz] = meshgrid(x,y,z); contour(xx,yy,zz)

How to make mesh or contour by using just x,y,z coordinates data ?

[xx,yy,zz] = meshgrid(x,y,z); contour(xx,yy,zz)

mer än 5 år ago | 0

Answered

calculate days between two dates

date0 = '08Apr1978'; date1 = '18Jan1978'; dForm = 'ddmmmyyyy'; % Date Format String, datenum does not necessarily need t...

calculate days between two dates

date0 = '08Apr1978'; date1 = '18Jan1978'; dForm = 'ddmmmyyyy'; % Date Format String, datenum does not necessarily need t...

mer än 5 år ago | 0

| accepted

Answered

How to store two tables resulting from a for loop

Try this. t1 = table(); t1.Name = 'My Name'; t1.Age = 89; data = table(); data.Name = 'Your Name'; data.A...

How to store two tables resulting from a for loop

Try this. t1 = table(); t1.Name = 'My Name'; t1.Age = 89; data = table(); data.Name = 'Your Name'; data.A...

mer än 5 år ago | 0

Answered

What is missing from MATLAB?

The ability to * Define the main class and inner classes in one single m-file. * Ternary operator. * Matrix-unpacking such ...

What is missing from MATLAB?

The ability to * Define the main class and inner classes in one single m-file. * Ternary operator. * Matrix-unpacking such ...

ungefär 6 år ago | 0

Answered

matlab code to make values of an array in specific ranges(index positions) equal to zero

Hi, I hope this is want you want. d=[1 2 3 4 5 6 7 8 9 10 11 12 13]; start_index_positions=[2 6 10]; end_index_positions=...

matlab code to make values of an array in specific ranges(index positions) equal to zero

Hi, I hope this is want you want. d=[1 2 3 4 5 6 7 8 9 10 11 12 13]; start_index_positions=[2 6 10]; end_index_positions=...

ungefär 6 år ago | 0

Answered

If I have a 20-digit numeric string, how can I convert it to an array where the elements are the digits of the string?

Ok, try this code: n = '9555688756196283262165034064'; matrix = arrayfun(@str2double ,n);

If I have a 20-digit numeric string, how can I convert it to an array where the elements are the digits of the string?

Ok, try this code: n = '9555688756196283262165034064'; matrix = arrayfun(@str2double ,n);

ungefär 6 år ago | 0

Answered

Adding new column to a matrix with the same number repeated

Hi, let's try this: [nRows,nCols] = size(yourMatrix); yourMatrix = [yourMatrix 2*ones(nRows,1)]; % This is called mat...

Adding new column to a matrix with the same number repeated

Hi, let's try this: [nRows,nCols] = size(yourMatrix); yourMatrix = [yourMatrix 2*ones(nRows,1)]; % This is called mat...

ungefär 6 år ago | 0

Answered

removing suffiex or prefix from sting

try this: str = 'unbecomingly'; prefix = 'un'; % The prefix to remove suffix = 'ly'; % The suffix to remove regex =...

removing suffiex or prefix from sting

try this: str = 'unbecomingly'; prefix = 'un'; % The prefix to remove suffix = 'ly'; % The suffix to remove regex =...

ungefär 6 år ago | 3

Answered

sum of doubles of different cells

This function should do what you want. function C = cellsum(A,B) if iscell(A) && iscell(B) C = cellfun(@(x,y...

sum of doubles of different cells

This function should do what you want. function C = cellsum(A,B) if iscell(A) && iscell(B) C = cellfun(@(x,y...

mer än 6 år ago | 1

| accepted

Answered

how can I sort the arrays according to example I explained below?

Ok, try this. CoEff=[1 3 5 2 4;2 5 3 1 6;4 2 6 3 1]; Result= [51 25 34]; [~,locs]=ismember(sort(Result),Result); %% CoE...

how can I sort the arrays according to example I explained below?

Ok, try this. CoEff=[1 3 5 2 4;2 5 3 1 6;4 2 6 3 1]; Result= [51 25 34]; [~,locs]=ismember(sort(Result),Result); %% CoE...

mer än 6 år ago | 0

Answered

How to make splash screen work while deploying to stand alone?

The splash image should be in the same directory as the app; so make sure you have an image named "splash.png" in your app direc...

How to make splash screen work while deploying to stand alone?

The splash image should be in the same directory as the app; so make sure you have an image named "splash.png" in your app direc...

mer än 6 år ago | 0

Answered

Plot a variable in x-y plane.

Try this: Remember that on the x-y plane, the value of z is zero. plot3(z,h,zeros(size(h))); % plots h vs z on the x-y pl...

Plot a variable in x-y plane.

Try this: Remember that on the x-y plane, the value of z is zero. plot3(z,h,zeros(size(h))); % plots h vs z on the x-y pl...

mer än 6 år ago | 0

Answered

how to find interval of data

Will this do: interval = 2; % 2 hour-interval maxHr = 23; tmstamp = 0 : interval : maxHr; len = length(tmstamp...

how to find interval of data

Will this do: interval = 2; % 2 hour-interval maxHr = 23; tmstamp = 0 : interval : maxHr; len = length(tmstamp...

mer än 6 år ago | 1

| accepted

Answered

find string pattern in strings ( 'ab*d' in 'abcd')

I presume that you want it to work for all patterns 'ab.*d' that don't contain the letter "n" or "N", such that "abCDnMMd" does ...

find string pattern in strings ( 'ab*d' in 'abcd')

I presume that you want it to work for all patterns 'ab.*d' that don't contain the letter "n" or "N", such that "abCDnMMd" does ...

mer än 6 år ago | 0

Answered

How can i use both the left and right y axis on a single figure?

Ok, try this: x = linspace(0,2*pi,100); y1 = 2*cos(x); y2 = -2*sin(x); y3 = 5*sin(2*x); y4 = -10.5*sin(5*x); [hAx,...

How can i use both the left and right y axis on a single figure?

Ok, try this: x = linspace(0,2*pi,100); y1 = 2*cos(x); y2 = -2*sin(x); y3 = 5*sin(2*x); y4 = -10.5*sin(5*x); [hAx,...

mer än 6 år ago | 0

Answered

find string pattern in strings ( 'ab*d' in 'abcd')

try this: pattern = 'ab.*d'; %% Pattern to match textstr = 'sqthabVUYd'; %% Input string match = regexp(text...

find string pattern in strings ( 'ab*d' in 'abcd')

try this: pattern = 'ab.*d'; %% Pattern to match textstr = 'sqthabVUYd'; %% Input string match = regexp(text...

mer än 6 år ago | 0

| accepted

Answered

How can i use both the left and right y axis on a single figure?

try the _plotyy_ command. In the command window type doc plotyy to see examples of how to use the function.

How can i use both the left and right y axis on a single figure?

try the _plotyy_ command. In the command window type doc plotyy to see examples of how to use the function.

mer än 6 år ago | 0

Answered

Need help in matrix dimension while converting from fortran to matlab

The error is due to the fact that at first double_sum is used as a variable to which a value is being assigned double_sum =...

Need help in matrix dimension while converting from fortran to matlab

The error is due to the fact that at first double_sum is used as a variable to which a value is being assigned double_sum =...

mer än 6 år ago | 0

Answered

Javaaddpath to files not in Java folder

Try supplying the full filepath to the javaaddpath function. Something like poi_dir = "C:/JavaLibs"; poi_lib = "poi_libr...

Javaaddpath to files not in Java folder

Try supplying the full filepath to the javaaddpath function. Something like poi_dir = "C:/JavaLibs"; poi_lib = "poi_libr...

mer än 6 år ago | 0

Answered

Error using mtimes Inner matrix dimensions must agree !!

Are you doing elementwise multiplication? If so, then replace the '*' operator with '.*' operator, Such that phi0(:,t)=[...

Error using mtimes Inner matrix dimensions must agree !!

Are you doing elementwise multiplication? If so, then replace the '*' operator with '.*' operator, Such that phi0(:,t)=[...

mer än 6 år ago | 0

Answered

How to Concatenate two matrix's each elements ?

Let's try: syms a b c d e f g h i % initialize symbols A = [a b c;d e f;g h i]; B = [1 2 3;4 5 6;7 8 9]; sz = siz...

How to Concatenate two matrix's each elements ?

Let's try: syms a b c d e f g h i % initialize symbols A = [a b c;d e f;g h i]; B = [1 2 3;4 5 6;7 8 9]; sz = siz...

mer än 6 år ago | 0

| accepted