Answered

How can I change contents of a string?

I'd say do something like this: names = strrep({data{:,1}},'/','-'); That assumes that all of the names are only in the ...

How can I change contents of a string?

I'd say do something like this: names = strrep({data{:,1}},'/','-'); That assumes that all of the names are only in the ...

ongeveer 8 jaar ago | 0

Solved

Sum of diagonal of a square matrix

If x = [1 2 4; 3 4 5; 5 6 7] then y should be the sum of the diagonals of the matrix y = 1 + 4 + 7 = 12

meer dan 8 jaar ago

Solved

Given an unsigned integer x, find the largest y by rearranging the bits in x

Given an unsigned integer x, find the largest y by rearranging the bits in x. Example: Input x = 10 Output y is 12 ...

meer dan 8 jaar ago

Answered

Calculate difference between two times

since you're getting this from a data file I'd suggest something like this: fid = fopen('data.txt'); data = textscan(fid...

Calculate difference between two times

since you're getting this from a data file I'd suggest something like this: fid = fopen('data.txt'); data = textscan(fid...

meer dan 8 jaar ago | 0

Answered

Loop Principal Component Analysis

I'd suggest looking at the help page a little more for PCA: http://www.mathworks.com/help/toolbox/stats/princomp.html "COE...

Loop Principal Component Analysis

I'd suggest looking at the help page a little more for PCA: http://www.mathworks.com/help/toolbox/stats/princomp.html "COE...

meer dan 8 jaar ago | 0

Answered

Saving structs

If you're wanting to save the structure as a structure, don't put in the -struct flag. That saves all of the fieldnames as their...

Saving structs

If you're wanting to save the structure as a structure, don't put in the -struct flag. That saves all of the fieldnames as their...

meer dan 8 jaar ago | 2

| accepted

Answered

breaking a column of strings in two different columns

It appears that you can't really do matrix operations on cell arrays like: mycell{:,2} = mycell{:,1}(3:end); So here's w...

breaking a column of strings in two different columns

It appears that you can't really do matrix operations on cell arrays like: mycell{:,2} = mycell{:,1}(3:end); So here's w...

meer dan 8 jaar ago | 1

| accepted

Answered

Writing a matrix as column vectors

If Y is a workspace variable that is an m x n matrix, then you can extract the column vectors by: y1 = Y(:,1); etc. Is that...

Writing a matrix as column vectors

If Y is a workspace variable that is an m x n matrix, then you can extract the column vectors by: y1 = Y(:,1); etc. Is that...

meer dan 8 jaar ago | 0

Answered

set default properties ERROR

It looks as though you may have a variable named 'set' in your workspace. Is that the case?

set default properties ERROR

It looks as though you may have a variable named 'set' in your workspace. Is that the case?

meer dan 8 jaar ago | 1

| accepted

Answered

surf plot behaves strange!

Surf attaches a color to a face based on one point on that face, and each face will be created by 4 points, so that color may no...

surf plot behaves strange!

Surf attaches a color to a face based on one point on that face, and each face will be created by 4 points, so that color may no...

meer dan 8 jaar ago | 0

Answered

GRIDDATA suitability for interpolating from one mesh to another

griddata (in this case griddata3) is going to be removed in a future release of Matlab. Use TriScatteredInterp instead. I've use...

GRIDDATA suitability for interpolating from one mesh to another

griddata (in this case griddata3) is going to be removed in a future release of Matlab. Use TriScatteredInterp instead. I've use...

meer dan 8 jaar ago | 0

| accepted

Answered

How to create random vectors of the same lengths?

from the documentation: Examples Generate values from the uniform distribution on the interval [a, b]. r = a + (b-a).*ra...

How to create random vectors of the same lengths?

from the documentation: Examples Generate values from the uniform distribution on the interval [a, b]. r = a + (b-a).*ra...

meer dan 8 jaar ago | 0

| accepted

Answered

for loop

You can't call or write to a variable like that in a loop, unfortunately. My suggestion would be to have a structure that contai...

for loop

You can't call or write to a variable like that in a loop, unfortunately. My suggestion would be to have a structure that contai...

meer dan 8 jaar ago | 0

Answered

Plot points with unknown column numbers

Here's the fix, sorry it took a while. Got distracted ;) figure(2) names = 1:1:rx; for i =1:1:rx name = i; ...

Plot points with unknown column numbers

Here's the fix, sorry it took a while. Got distracted ;) figure(2) names = 1:1:rx; for i =1:1:rx name = i; ...

meer dan 8 jaar ago | 0

| accepted

Answered

Plot points with unknown column numbers

did you turn hold back off? figure(2) names = 1:1:rx; for i =1:1:rx name = i; plot (fx,fy,'bo') ...

Plot points with unknown column numbers

did you turn hold back off? figure(2) names = 1:1:rx; for i =1:1:rx name = i; plot (fx,fy,'bo') ...

meer dan 8 jaar ago | 0

Answered

geting value as Inf

Here's what I think your code should look like in order to run properly: M=100; r=0.8; alpha=0.45; beta=0.75; g...

geting value as Inf

Here's what I think your code should look like in order to run properly: M=100; r=0.8; alpha=0.45; beta=0.75; g...

meer dan 8 jaar ago | 0

| accepted

Answered

Passing base workspace variables to callback functions

Have you tried using the evalin function, maybe something like: x = evalin('base','var');

Passing base workspace variables to callback functions

Have you tried using the evalin function, maybe something like: x = evalin('base','var');

meer dan 8 jaar ago | 1

Answered

geting value as Inf

I actually answered your problem in your previous problem. The error is in your calculations for c, p, and specifically a. These...

geting value as Inf

I actually answered your problem in your previous problem. The error is in your calculations for c, p, and specifically a. These...

meer dan 8 jaar ago | 0

Solved

Magic!

Check whether the input matrix is a normal magic square: <http://en.wikipedia.org/wiki/Magic_square> Output the logical va...

meer dan 8 jaar ago

Solved

Count from 0 to N^M in base N.

Return an array of numbers which (effectively) count from 0 to N^M-1 in base N. The result should be returned in a matrix, with ...

meer dan 8 jaar ago

Answered

How can i get image from other GUI in a project - i can not use global variable

I'm assuming that the problem is you're unable to use the information you acquired from GUI2. Globals may work, but they're not ...

How can i get image from other GUI in a project - i can not use global variable

I'm assuming that the problem is you're unable to use the information you acquired from GUI2. Globals may work, but they're not ...

meer dan 8 jaar ago | 2

Answered

need help optimizing this code...

I don't think that will work actually. Try this, it's a little convoluted, but I think it's correct: % this assumes w and s...

need help optimizing this code...

I don't think that will work actually. Try this, it's a little convoluted, but I think it's correct: % this assumes w and s...

meer dan 8 jaar ago | 0

Answered

color-coding a 2D plot

unfortunately shading interp doesn't seem to work on contourf so here's an inelegant solution to your problem. [x,y] = mesh...

color-coding a 2D plot

unfortunately shading interp doesn't seem to work on contourf so here's an inelegant solution to your problem. [x,y] = mesh...

meer dan 8 jaar ago | 1

| accepted

Answered

Problem with displaying output of executable

If you're compiling it as a 'Windows Standalone Application' switch that to a 'Console Standalone Application'.

Problem with displaying output of executable

If you're compiling it as a 'Windows Standalone Application' switch that to a 'Console Standalone Application'.

meer dan 8 jaar ago | 0

| accepted

Answered

color-coding a 2D plot

how about: [x,y] = meshgrid(-10:0.1:10,-10:0.1:10); % just to get some x and y values z = sqrt(x.^2 + y.^2); contour...

color-coding a 2D plot

how about: [x,y] = meshgrid(-10:0.1:10,-10:0.1:10); % just to get some x and y values z = sqrt(x.^2 + y.^2); contour...

meer dan 8 jaar ago | 0

Answered

Add label to TXT file

you could just add a simple fopen command prior to your dlmwrite command: fid = fopen('c:\data.txt','w'); fprintf(fid,'H...

Add label to TXT file

you could just add a simple fopen command prior to your dlmwrite command: fid = fopen('c:\data.txt','w'); fprintf(fid,'H...

meer dan 8 jaar ago | 0

Answered

Change position of numbers on x axes in surface plot

Perhaps something like this would work for you? grid off %this prevents the addition of gridlines at half spacing ha =...

Change position of numbers on x axes in surface plot

Perhaps something like this would work for you? grid off %this prevents the addition of gridlines at half spacing ha =...

meer dan 8 jaar ago | 0

| accepted