Professional Interests: Atmospheric science, biosurveillance, HAZMAT modeling

Answered

Convert cell of strings to numbers

If your cell array includes only numbers, you can use cell2mat

Convert cell of strings to numbers

If your cell array includes only numbers, you can use cell2mat

mer än 5 år ago | 0

Answered

how to write general code for generating points

You can write the for loop in the following way: for I=1:m x1 = LB(I)+(UB(I)-LB(I))*rand(500,1); X = [X x1];...

how to write general code for generating points

You can write the for loop in the following way: for I=1:m x1 = LB(I)+(UB(I)-LB(I))*rand(500,1); X = [X x1];...

mer än 5 år ago | 0

Answered

Speeding up matrix comparison within a loop (logical indexing???)

Without having any data to test it, I'd say you could do: for i=2:12 x = squeeze(imlab50(i,:,:,:)); outpu...

Speeding up matrix comparison within a loop (logical indexing???)

Without having any data to test it, I'd say you could do: for i=2:12 x = squeeze(imlab50(i,:,:,:)); outpu...

mer än 5 år ago | 0

Answered

Doubt regarding ode45 plotting

ode45(@(t,x)DFG789(t,x,var_1),..... Then the function becomes: function dB = DFG789(Z1,B,var_1)

Doubt regarding ode45 plotting

ode45(@(t,x)DFG789(t,x,var_1),..... Then the function becomes: function dB = DFG789(Z1,B,var_1)

mer än 5 år ago | 0

Answered

Recursive concatenation of cell arrays

Events_ext2 = Events_ext; i = 0; while i < numel(Events_ext2)-1 i = i + 1; if(Events_ext2{i+1}(1)-Events_e...

Recursive concatenation of cell arrays

Events_ext2 = Events_ext; i = 0; while i < numel(Events_ext2)-1 i = i + 1; if(Events_ext2{i+1}(1)-Events_e...

mer än 5 år ago | 0

| accepted

Answered

Plot single vector from 3D array

Try this: plot(squeeze(MyVar(1,1,:)))

Plot single vector from 3D array

Try this: plot(squeeze(MyVar(1,1,:)))

mer än 5 år ago | 2

| accepted

Answered

horizontal lines in candle chart

x = [0 60]; ylev = [0 23.6 38.2]; % add all levels you want hold on; for i = 1:numel(ylev) plot(x,[ylev(i) ylev(...

horizontal lines in candle chart

x = [0 60]; ylev = [0 23.6 38.2]; % add all levels you want hold on; for i = 1:numel(ylev) plot(x,[ylev(i) ylev(...

mer än 5 år ago | 1

| accepted

Answered

Position of a data at Matrix

Given the matrix A [i,j] = find(A == max(max(A))

Position of a data at Matrix

Given the matrix A [i,j] = find(A == max(max(A))

mer än 5 år ago | 1

| accepted

Answered

Writing Character Strings from Text file to CSV, Error using fprintf Function is not defined for 'cell' inputs

Use C = C{1} after the textscan command. But, why not using csvwrite later?

Writing Character Strings from Text file to CSV, Error using fprintf Function is not defined for 'cell' inputs

Use C = C{1} after the textscan command. But, why not using csvwrite later?

mer än 5 år ago | 0

Answered

Displaying a saved value in plot's textbox.

Replace: 'Area_s_s = ' with ['Area_s_s = ',num2str(a),'kJm^-3'] in the annotation. It's also better if you use ...

Displaying a saved value in plot's textbox.

Replace: 'Area_s_s = ' with ['Area_s_s = ',num2str(a),'kJm^-3'] in the annotation. It's also better if you use ...

mer än 5 år ago | 0

Answered

save results in new struct

Here is how your code will look like: if true empty_max.cost=[] mymax=repmat(empty_max,[3,3,2,numel(A)]) for...

save results in new struct

Here is how your code will look like: if true empty_max.cost=[] mymax=repmat(empty_max,[3,3,2,numel(A)]) for...

mer än 5 år ago | 0

| accepted

Answered

How to split columns up into different numbers of figures?

% This values are here just to show an example n = 7; % num A = zeros(10,n); for i = 1:n A(:,i) = i; end ...

How to split columns up into different numbers of figures?

% This values are here just to show an example n = 7; % num A = zeros(10,n); for i = 1:n A(:,i) = i; end ...

mer än 5 år ago | 0

| accepted

Answered

Importing different sheets of an Excel Data

You can retrieve the name of the sheets in an excel file with xlsfinfo

Importing different sheets of an Excel Data

You can retrieve the name of the sheets in an excel file with xlsfinfo

mer än 5 år ago | 0

| accepted

Answered

plotting 2 vectors of different

with hold on. figure plot(x1) hold on plot(x2)

plotting 2 vectors of different

with hold on. figure plot(x1) hold on plot(x2)

nästan 6 år ago | 1

| accepted

Answered

how use GUI outputs (variables) in another .m file?

If you just want to calc the result once you've inputted the values, you can do: In function pushbutton1_Calculate_Callback(h...

how use GUI outputs (variables) in another .m file?

If you just want to calc the result once you've inputted the values, you can do: In function pushbutton1_Calculate_Callback(h...

nästan 6 år ago | 0

Answered

Change positions of specific compoent based on conditions

Use the handles variable to carry around your values. In the opening function, do: handles.origin = ..... handles.prev =...

Change positions of specific compoent based on conditions

Use the handles variable to carry around your values. In the opening function, do: handles.origin = ..... handles.prev =...

nästan 6 år ago | 0

| accepted

Answered

hello, i am new on matlab and i keep getting this msg : matrix dimensions must agree!! any help please? its line 28

Replace lines with this dV = kconst*dq ./ ( ( (kx0-x).^2+(ky0-y).^2+(kz0-z).^2 ).^0.5 ); V(ki)= sum(sum(dV)); % ca...

hello, i am new on matlab and i keep getting this msg : matrix dimensions must agree!! any help please? its line 28

Replace lines with this dV = kconst*dq ./ ( ( (kx0-x).^2+(ky0-y).^2+(kz0-z).^2 ).^0.5 ); V(ki)= sum(sum(dV)); % ca...

nästan 6 år ago | 0

Answered

Help needed with matrix in for-loop and output of matrix

With x,y column vectors: A = [x,y]; B = sortrows(A,1); unique_x = unique(B(:,1)); new_matrix = zeros(numel(unique_x),2...

Help needed with matrix in for-loop and output of matrix

With x,y column vectors: A = [x,y]; B = sortrows(A,1); unique_x = unique(B(:,1)); new_matrix = zeros(numel(unique_x),2...

nästan 6 år ago | 3

| accepted

Question

Zoom behavior in figure embedded in GUI

I have built a GUI that contains some axes and created a pushbutton to let the user zoom in and out of the image. I can't figure...

nästan 6 år ago | 2 answers | 0

Answered

Mirror of countourf on X, Y axis

Look at the following example. If x and y start from 0, you can repeat the contour command 4 times. otherwise, you need to trans...

Mirror of countourf on X, Y axis

Look at the following example. If x and y start from 0, you can repeat the contour command 4 times. otherwise, you need to trans...

ungefär 6 år ago | 0

| accepted

Answered

operands to the and && operators must be convertible to logical scalar

In find you need to use & not &&

operands to the and && operators must be convertible to logical scalar

In find you need to use & not &&

ungefär 6 år ago | 0

Answered

How can I save a string from a uicontrol edit box into a a part of my structure ?

You have to put your string into the handles structure as handles.s_Name = s_Name; and then save it with: guidata...

How can I save a string from a uicontrol edit box into a a part of my structure ?

You have to put your string into the handles structure as handles.s_Name = s_Name; and then save it with: guidata...

ungefär 6 år ago | 0

| accepted

Answered

Pass Data between Gui`s

In GUI_1, store everything you need to share in handles, and call GUI_2 as: GUI_2(handles) This may go into a pushbutton...

Pass Data between Gui`s

In GUI_1, store everything you need to share in handles, and call GUI_2 as: GUI_2(handles) This may go into a pushbutton...

ungefär 6 år ago | 4

Answered

how to plot grid mapping for robot path planning ?

Adapt to your case the following script. I've colored the rectangles with facecolor, but you can eliminate that if you want just...

how to plot grid mapping for robot path planning ?

Adapt to your case the following script. I've colored the rectangles with facecolor, but you can eliminate that if you want just...

ungefär 6 år ago | 0

Answered

Modifying files and merge files

fid1 = fopen('filewithdates','r'); fid2 = fopen('filewithhours','r'); fid3 = fopen('output.txt','w'); w...

Modifying files and merge files

fid1 = fopen('filewithdates','r'); fid2 = fopen('filewithhours','r'); fid3 = fopen('output.txt','w'); w...

ungefär 6 år ago | 1

Answered

how to write this data in text file?

Try this: sets = rand(9,5) for i = 1:9 fprintf(fid,'%.2f ',sets(i,:) ); fprintf(fid,'\n'); end

how to write this data in text file?

Try this: sets = rand(9,5) for i = 1:9 fprintf(fid,'%.2f ',sets(i,:) ); fprintf(fid,'\n'); end

ungefär 6 år ago | 0

| accepted

Answered

How can I generate a grid schematic in MATLAB?

Take a look at the code. nrow and ncol will be your adjustable inputs. Now the code wait for the user to click on the image (gin...

How can I generate a grid schematic in MATLAB?

Take a look at the code. nrow and ncol will be your adjustable inputs. Now the code wait for the user to click on the image (gin...

ungefär 6 år ago | 2

| accepted

Answered

GUIDE outputting a .txt file

Look up fopen, fprintf, and fclose. Your code will be something like this: fid = fopen('filename.txt','w'); fprintf(fid,...

GUIDE outputting a .txt file

Look up fopen, fprintf, and fclose. Your code will be something like this: fid = fopen('filename.txt','w'); fprintf(fid,...

ungefär 6 år ago | 0

| accepted

Answered

How do I access files not added to my matlab path?

You need to provide to imread not just the file name but the full path. You can use fullfile to build it.

How do I access files not added to my matlab path?

You need to provide to imread not just the file name but the full path. You can use fullfile to build it.

ungefär 6 år ago | 0