**Statistics**

RANK**93**

of 242 820

REPUTATION**1 070**

CONTRIBUTIONS

**1** Question

**407** Answers

ANSWER ACCEPTANCE **
0.0%
**

VOTES RECEIVED**93**

RANK

of 16 984

REPUTATION**N/A**

AVERAGE RATING**0.00**

CONTRIBUTIONS**0** Files

DOWNLOADS **0**

ALL TIME DOWNLOADS**0**

CONTRIBUTIONS**0 Posts**

CONTRIBUTIONS**0** Public Channels

AVERAGE RATING

CONTRIBUTIONS**0** Highlights

AVERAGE NO. OF LIKES

**Content Feed**

How do I use a user input string to reference a structure that already exists?

Here is one solution without dynamically naming a variable: ... UserInput='ExistingStructure'; if exist(userInput, 'var') ...

2 dagar ago | 0

Group values of a vector into new vectors according to magnitude

A = [17 323 100 3 278 220 45 351 212 51] B = A(A>=0 & A<50) C= A(A>=50 & A<100) % Leave D for you

3 dagar ago | 0

| accepted

How to get the file names that start with the same letter in the folder?

fn = dir('T*.*') % you can use 'T*.T', 'T15*.bin', etc

3 dagar ago | 0

How to connect dots in figure?

% data x = randn(50, 6)*.5+(1:6); % 6 lines, 50 data points each line % if you really want to plot 50 lines, then: plot(x') ...

3 dagar ago | 0

combine different size vectors into one matrix

% use a cell array instead of separate variables e{1}=[2 3 4 5]; e{2}=[4 7 7]; e{3}=[8 8 7 4 2 5]; % find the longest vect...

3 dagar ago | 0

| accepted

Matlab 3D bar plot

xyz=[... 6.50319529000000 10 5 6.50463629000000 10 10 6.50548840000000 10 15 6.50607061000000 ...

3 dagar ago | 0

| accepted

How to combine and transpose arrays?

s1 = rand(5,1); s2 = rand(5,1); s3 = rand(5,1); s4 = rand(5,1); imp =[s1 s2 s3 s4]' % or imp1 = cat(2, s1, s2, s3, s4)' ...

3 dagar ago | 1

I need to read third coloumn and all rows of text file in matlab. Pls give your suggestions.

You can read all data (xyz.txt contains first part of your data). Then it is up to you to use which column of data. data = rea...

3 dagar ago | 0

How do I switch location of the largest and smallest elements of an array?

vect = randi(20,1,15) [~, imax] = max(vect) [~, imin] = min(vect) % swap tmp = vect(imax); vect(imax) = vect(imin); vect...

3 dagar ago | 0

Only graphing two out of three of my graphs

ch0 = ex32excel(:,2); ch1 = ex32excel(:,4); N = length(ch0); deltast = 2e-5; t1 = 0:deltast:deltast*(N-1); xlow=0.02394;...

3 dagar ago | 0

solving for complex numbers

A = 3+4j B = 3 -2j C = 2*exp(1j*deg2rad(50)) % Find out D yourself

3 dagar ago | 0

How to plot several signals in 3D

t = 0 : 10e-5 : 2e-2; y1 = sin(2*pi*50*t); y2 = sin(2*pi*100*t); f = [0 2 4]; plot3(t, f(1)*ones(size(t)), y1); hold on p...

4 dagar ago | 0

| accepted

How can I plot the graph?

x = 0:100; plot(x,carFunc(x)); ylim([0 30]) function output = carFunc(x) output = zeros(size(x)); idx = (x >= 75...

4 dagar ago | 1

| accepted

How to downsample a vector x by an integer factor M with a single statement such as for loop or conditional statements

a = 1:10; b = downsample(a, 3) % use downsample c = a(1:3:end) % statement

4 dagar ago | 0

| accepted

Why is MATLAB producing the wrong output with this function?

beamLoc = [10 200 300] b = FindDeflection((beamLoc)) function [beamDef] = FindDeflection(beamLoc) A = (1/3.19e9); beamDef = ...

4 dagar ago | 0

| accepted

print numbers to command window

With mapping toolbox, you can use angl2str. doc angl2str for more details. A = 0; B = 206.4188; C = -130.5507; A1 = angl...

4 dagar ago | 0

| accepted

Problem obtaining minimum negative value in an array

t = linspace(0,15,400); y = exp(-0.5*t).*cos(2*pi.*t); plot_cos(t, y) % plot t-y or y-t? function m = plot_cos(t, y) plot(y...

4 dagar ago | 0

display functions and coefficients from the basic fit tool box on a plot

xy = [3.25 0.801369; 3.375 0.883622]; x = xy(:, 1); y = xy(:, 2); f1 = @(x) 0.6580*x-1.337209; f2 = @(x) 0.0632*...

5 dagar ago | 0

display functions and coefficients from the basic fit tool box on a plot

Use your own fitting function: % Some data x = 0:.1:10; y = x.^2 +2*x + 3 +randn(size(x))*.4; plot(x, y) % fitting (polyf...

5 dagar ago | 0

Can MATLAB recognized the name of a variable with input function?

It's possible but it should be avoided if possible. milk = 30; %x = input('what is the name of the object? ', 's') % use this...

5 dagar ago | 0

| accepted

How to change yellow fill to white in 'mapshow'

p = shaperead('concord_hydro_area.shp'); mapshow(p, 'FaceColor', 'y') % change 'y' to 'w' for white

6 dagar ago | 0

a problem with transpose of Symbolic matrix

The bar over the variable means complex conjugate. ' means complex conjugate transpose, while traspose or .' means transpose wi...

6 dagar ago | 0

| accepted

fill point in data

% Generate some data [x, y] = meshgrid(1:60, 1:50); x = x(:); y = y(:); z = 1./((x-30).^2+(y-20).^2); % make a square ho...

6 dagar ago | 0

How to Cell indexing

X1=11; X2=22; u{1}=[X1,X2]; u{1} % To access "one" element u{1}(1) u{1}(2)

7 dagar ago | 1

How can I have proper alignment in my output?

Try something like this to align the text: fprintf('%-30s', 'Numeric Daily Averages:'); fprintf('%10.2f ', rand(1,4)); fprintf(...

7 dagar ago | 1

| accepted

Indexing by using column names

A = zeros(3,1); B=rand(3,1); C=ones(3,1); T = table(A, B, C) VarNames = {'A', 'C'}; col_index = ismember(T.Properties.Variabl...

7 dagar ago | 1

| accepted

How to convert interval from to scalar. The problem is:

Do you mean a loop over a number of interals? k = -0.5:.05:-0.1; %(interval) for i=1:length(k) prob.Objective = k(i) * f...

7 dagar ago | 0

how to convert vector char to matrix char ?

You don't need to do anything. X is already an array. X = 'ABCDEFGHIJKLMNOPQRSTWXYZ' X(2) X(1,2)

7 dagar ago | 2

How can I write a magic(5) matrix to a text file with special delimiters?

x = magic(5); fid = fopen('test.txt', 'w'); fprintf(fid, '%f\n', x); % try different format here fclose(fid) type('test.t...

7 dagar ago | 1

| accepted