Beantwortet
I am looking to use a user input to define how many rand 1 row by 6 columns matrices i need
randi(53,x,6) Each row is a 'ticket'

fast 8 Jahre vor | 0

| akzeptiert

Beantwortet
My while loop is giving an error "Array indices must be positive integers or logical values." I'm trying to calculate the golden ratio within epsilon 0.001.
Probably something more like this: %Program Description: %This program takes 2 numerical inputs and calculates/estimates...

fast 8 Jahre vor | 1

| akzeptiert

Beantwortet
Building a vector array in for loop from if statements
You can build the output array dynamically. This is generally frowned upon, but unless the arrays are large it's unlikely to mak...

fast 8 Jahre vor | 1

| akzeptiert

Beantwortet
How to add variable names for each column when using array2table
a=[1 2 3 4 5 6 7;1 2 3 4 5 6 7] b=array2table(a,'VariableNames',{'col1','col2','col3','col4','col5','col6','col7'})

fast 8 Jahre vor | 2

| akzeptiert

Beantwortet
I am writing a loop to find a piece of data is a large dataset, psws. How can I write code to extract the corresponding data which are in the same row but different columns to the data point which I found through the loop.
Depends what columns you want psws(i,:) %Extracts all columns from row i of psws psws(i,[2:4 7 10]) %Extracts co...

fast 8 Jahre vor | 0

Beantwortet
Displaying random image from array of file names
I have no idea what structure you have your image file names stored in, so I can only give an example of something that does wor...

fast 8 Jahre vor | 0

Beantwortet
My professor assigned me to do the this homework with two numbers and writing a code that find which one is the prime for these two numbers
So what is the problem? The only obvious issue I see is that it doesn't check if the number is negative: function pr=Truepr...

fast 8 Jahre vor | 0

| akzeptiert

Beantwortet
Delete columns from a matrix
diff=size(class1,2)-size(class2,2) deletionList=randperm(size(class1,2),diff) class1(:,deletionList)=[]

fast 8 Jahre vor | 0

| akzeptiert

Beantwortet
How can i create a descriptive statistics table for columns
The default behavior for most of the statistical function is for column-wise operation and since that is what you want you can j...

fast 8 Jahre vor | 1

| akzeptiert

Beantwortet
How Do I use nested for loops to first go through every column, and then do a calculation for every row of that column.
matrix = csvread('M3_Data_HeatingTimeHistories2.csv') [rows,ncolumns] = size(matrix); % finds size of matrix ...

fast 8 Jahre vor | 0

Beantwortet
Compute distances between an element and all other elements of a matrix
If you have the statistics toolbox you can use pdist2 m=[1 1 1 1;2 2 2 2;3 3 3 3;4 4 4 4;5 5 5 5] dist1=pdist2(m(1,:...

fast 8 Jahre vor | 0

| akzeptiert

Beantwortet
How to extract the string left and right to the matching alphabet
strs={'VA00K100E4TOO';'ZVA00K100E4TOO';'VZA00K100E6TO';'VB00K100E4TOO';'VP00K50E4T4O';'ZVG00K100E4TOO';'VF00K40E4T5O'} ...

fast 8 Jahre vor | 0

| akzeptiert

Beantwortet
Function definitions must appear at end of file
As it says, if you are going to have a function in the same file as a script, the function must go at the bottom. Until about ve...

fast 8 Jahre vor | 0

| akzeptiert

Beantwortet
For Loop operating with last and first entry of array
Like this? A=[1;5;6;8]; B=A(1:length(A))+[A(2:length(A));A(1)] B = 6 11 14 9

fast 8 Jahre vor | 0

Beantwortet
If I have a 1 x 32 array with values, how can i manipulate the array into two variables in the following order ?
testMatrix=1:32; x=circshift(1:17,1) y=circshift(16:32,-1) testMatrix(x) testMatrix(y)

fast 8 Jahre vor | 0

Beantwortet
Expanding array from seconds to samples
Something like this? bad_seconds = [1 2 11 13 14 15 17 18 22 24 26 27 37 47 48 50 57 58 70 75 90 118 120 144 145 147] ...

fast 8 Jahre vor | 0

| akzeptiert

Beantwortet
removing zeros from a matrix
x(x==0)=[]

fast 8 Jahre vor | 1

| akzeptiert

Beantwortet
I am getting that error explanation"function [out] = celsi2farh( x, i ) ↑ Error: Function definition not supported in this context. Create functions in code file." Could you please helpm me to get rid of this error ?
I think recent versions of Matlab (I don't know from which version) allow a function to be put on the bottom of a script file, b...

fast 8 Jahre vor | 0

Beantwortet
How can I find the second last value of a vector?
W(end-1)

fast 8 Jahre vor | 4

| akzeptiert

Beantwortet
How to find multiple numbers in a matrix
A = [1 2 3 3 5 6; 7 8 3 3 5 12; 13 14 3 3 17 5]; b=A==3 | A==5

fast 8 Jahre vor | 0

Beantwortet
creating function to find odd numbers upto 10000 having sum of its digits an odd number itself( e.g. 29)
%Create list of odd numbers as cell array of character vectors oddNum_str=regexp(num2str(1:2:10000),'\d+','match'); resu...

fast 8 Jahre vor | 0

Beantwortet
"Subscript indices must either be real positive integers or logicals."
if the number of words is low (as it would get after a few repetitions) and rand is small, then the index could potentially be 0...

fast 8 Jahre vor | 0

Beantwortet
How can I have a function that has a string as the input.
You need to use strcmp(string1,string2) to compare as the size of the color variable might be a different length to whatever fix...

fast 8 Jahre vor | 0

Beantwortet
is it possible to restart progress of self-paced course
As far as I remember I went back and redid parts that I'd forgotten about. The progress doesn't reset, but it doesn't stop you r...

fast 8 Jahre vor | 0

Beantwortet
Why is the min() and max() function throwing an error?
min(outFHN) ans = -4.1601 I would assume that you have a variable called min in your workspace which is sh...

fast 8 Jahre vor | 1

| akzeptiert

Beantwortet
mean of elements of a matrix
mean(A(:)) Gives the mean of the entire matrix

fast 8 Jahre vor | 1

| akzeptiert

Beantwortet
Any suggestions on what I have done wrong?
The variable P in your loop condition is never being updated in the loop. So if the condition is true at the start of the loop i...

fast 8 Jahre vor | 0

| akzeptiert

Beantwortet
Getting "out of memory" while in for loop in huge matrix
testMatrix=randi(50,64,65536); %Extract first 9 row values for each column extract=testMatrix(1:9,:); I assume th...

fast 8 Jahre vor | 1

| akzeptiert

Beantwortet
How do i clean up dependent if statement?
shims=zeros(num,3) %Matrix for storing shim data s_top=inputdlg({'shim OD in m','shim ID in m','shim Thickness i...

fast 8 Jahre vor | 0

| akzeptiert

Beantwortet
Multiply a column by a number
A=A.*4

fast 8 Jahre vor | 0

| akzeptiert

Mehr laden