Réponse apportée
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'

plus de 8 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 8 ans il y a | 1

| A accepté

Réponse apportée
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...

plus de 8 ans il y a | 1

| A accepté

Réponse apportée
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'})

plus de 8 ans il y a | 2

| A accepté

Réponse apportée
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...

plus de 8 ans il y a | 0

Réponse apportée
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...

plus de 8 ans il y a | 0

Réponse apportée
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...

plus de 8 ans il y a | 0

| A accepté

Réponse apportée
Delete columns from a matrix
diff=size(class1,2)-size(class2,2) deletionList=randperm(size(class1,2),diff) class1(:,deletionList)=[]

plus de 8 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 8 ans il y a | 1

| A accepté

Réponse apportée
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 ...

plus de 8 ans il y a | 0

Réponse apportée
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,:...

plus de 8 ans il y a | 0

| A accepté

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

plus de 8 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 8 ans il y a | 0

| A accepté

Réponse apportée
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

plus de 8 ans il y a | 0

Réponse apportée
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)

plus de 8 ans il y a | 0

Réponse apportée
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] ...

plus de 8 ans il y a | 0

| A accepté

Réponse apportée
removing zeros from a matrix
x(x==0)=[]

plus de 8 ans il y a | 1

| A accepté

Réponse apportée
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...

plus de 8 ans il y a | 0

Réponse apportée
How can I find the second last value of a vector?
W(end-1)

plus de 8 ans il y a | 4

| A accepté

Réponse apportée
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

plus de 8 ans il y a | 0

Réponse apportée
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...

plus de 8 ans il y a | 0

Réponse apportée
"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...

plus de 8 ans il y a | 0

Réponse apportée
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...

plus de 8 ans il y a | 0

Réponse apportée
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...

plus de 8 ans il y a | 0

Réponse apportée
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...

plus de 8 ans il y a | 1

| A accepté

Réponse apportée
mean of elements of a matrix
mean(A(:)) Gives the mean of the entire matrix

plus de 8 ans il y a | 1

| A accepté

Réponse apportée
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...

plus de 8 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 8 ans il y a | 1

| A accepté

Réponse apportée
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...

plus de 8 ans il y a | 0

| A accepté

Réponse apportée
Multiply a column by a number
A=A.*4

plus de 8 ans il y a | 0

| A accepté

Charger plus